1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-27 08:23:49 +03:00

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 commit is contained in:
Andrew Tridgell
-
parent 42dbb8e2eb
commit 89f7261ba5
4 changed files with 19 additions and 13 deletions

View File

@@ -81,6 +81,15 @@
#include <stdlib.h>
#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 <stdio.h>
@@ -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,