summaryrefslogtreecommitdiffstats
path: root/Utilities/cmtar/compat
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-30 22:27:57 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-30 22:27:57 (GMT)
commitc09548b50e908e1357dd2001a36584d12344eabc (patch)
tree4e90d4a990e4af93a72651c8fcb9b9940b993d4e /Utilities/cmtar/compat
parent6534e66e61975903c554c2b751c0d2761e4fe181 (diff)
downloadCMake-c09548b50e908e1357dd2001a36584d12344eabc.zip
CMake-c09548b50e908e1357dd2001a36584d12344eabc.tar.gz
CMake-c09548b50e908e1357dd2001a36584d12344eabc.tar.bz2
COMP: Fix support for vsnprintf
Diffstat (limited to 'Utilities/cmtar/compat')
-rw-r--r--Utilities/cmtar/compat/compat.h8
-rw-r--r--Utilities/cmtar/compat/snprintf.c3
2 files changed, 7 insertions, 4 deletions
diff --git a/Utilities/cmtar/compat/compat.h b/Utilities/cmtar/compat/compat.h
index a42c06f..471bcad 100644
--- a/Utilities/cmtar/compat/compat.h
+++ b/Utilities/cmtar/compat/compat.h
@@ -201,10 +201,12 @@ int inet_aton(const char *, struct in_addr *);
#ifdef _MSC_VER /* compile snprintf only onwin32 */
#if !defined(HAVE_SNPRINTF)
int mutt_snprintf(char *, size_t, const char *, ...);
-int mutt_vsnprintf(char *, size_t, const char *, va_list);
-#define snprintf mutt_snprintf
-#define vsnprintf mutt_vsnprintf
+# define snprintf mutt_snprintf
+#endif
+#if !defined(HAVE_VSNPRINTF)
+int mutt_vsnprintf(char *, size_t, const char *, va_list);
+# define vsnprintf mutt_vsnprintf
#endif /* NEED_SNPRINTF && ! HAVE_SNPRINTF */
#endif
diff --git a/Utilities/cmtar/compat/snprintf.c b/Utilities/cmtar/compat/snprintf.c
index 24a17500..fbdf7c5 100644
--- a/Utilities/cmtar/compat/snprintf.c
+++ b/Utilities/cmtar/compat/snprintf.c
@@ -44,6 +44,7 @@
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
+#include <stdio.h>
#include <string.h>
# include <ctype.h>
#include <sys/types.h>
@@ -706,7 +707,7 @@ int mutt_snprintf (va_alist) va_dcl
VA_SHIFT (str, char *);
VA_SHIFT (count, size_t );
VA_SHIFT (fmt, char *);
- (void) mutt_vsnprintf(str, count, fmt, ap);
+ (void) vsnprintf(str, count, fmt, ap);
VA_END;
return(strlen(str));
}