From 4e73a3c0feb47c761fdcded9e6c2ac6d32534d9b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 10 Oct 2003 05:40:32 +0000 Subject: fixed snprintf.c for systems that have only some of the *printf() family of functions cope with servers that return bogus (too large) values in max_xmit cope with a couple more error conditions in RAW-SFILEINFO better startup time heuristics in NBENCH (This used to be commit 89f7261ba589e5760b3cf9c3594eab9d7198dd7e) --- source4/lib/snprintf.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/snprintf.c b/source4/lib/snprintf.c index 1eae2f09b9..fd31870162 100644 --- a/source4/lib/snprintf.c +++ b/source4/lib/snprintf.c @@ -81,6 +81,15 @@ #include #endif +#ifndef VA_COPY +#ifdef HAVE_VA_COPY +#define VA_COPY(dest, src) __va_copy(dest, src) +#else +#define VA_COPY(dest, src) (dest) = (src) +#endif +#endif + + #if defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF) && defined(HAVE_C99_VSNPRINTF) /* only include stdio.h if we are not re-defining snprintf or vsnprintf */ #include @@ -105,14 +114,6 @@ #define SAFE_FREE(x) do { if ((x) != NULL) {free((x)); (x)=NULL;} } while(0) #endif -#ifndef VA_COPY -#ifdef HAVE_VA_COPY -#define VA_COPY(dest, src) __va_copy(dest, src) -#else -#define VA_COPY(dest, src) (dest) = (src) -#endif -#endif - static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args_in); static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, -- cgit