diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-06-03 03:07:24 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-06-03 03:07:24 +0000 |
commit | 0bb6053946a1572a3496958e543d5c9ddf74120b (patch) | |
tree | b176a0e6a348c2d58d7ba52405a484d1384a6bb9 /source3/lib/snprintf.c | |
parent | 9401cdbb514a65b96910117a5a850af0eef45dd7 (diff) | |
download | samba-0bb6053946a1572a3496958e543d5c9ddf74120b.tar.gz samba-0bb6053946a1572a3496958e543d5c9ddf74120b.tar.xz samba-0bb6053946a1572a3496958e543d5c9ddf74120b.zip |
put the ifdef for HAVE_VA_COPY in one place rather than in lots of
functions
(This used to be commit 1cf3228fdc20f0314d1f8e71ad710a5e548b3f72)
Diffstat (limited to 'source3/lib/snprintf.c')
-rw-r--r-- | source3/lib/snprintf.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/source3/lib/snprintf.c b/source3/lib/snprintf.c index 561e775c8f0..aaad55f22ad 100644 --- a/source3/lib/snprintf.c +++ b/source3/lib/snprintf.c @@ -163,11 +163,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args size_t currlen; va_list args; -#if defined(HAVE_VA_COPY) - __va_copy(args, args_in); -#else - args = args_in; -#endif + VA_COPY(args, args_in); state = DP_S_DEFAULT; currlen = flags = cflags = min = 0; @@ -802,20 +798,16 @@ static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) int ret; va_list ap2; -#if defined(HAVE_VA_COPY) - __va_copy(ap2, ap); -#else - ap2 = ap; -#endif + VA_COPY(ap2, ap); ret = vsnprintf(NULL, 0, format, ap2); if (ret <= 0) return ret; (*ptr) = (char *)malloc(ret+1); if (!*ptr) return -1; -#if defined(HAVE_VA_COPY) - __va_copy(ap2, ap); -#endif + + VA_COPY(ap2, ap); + ret = vsnprintf(*ptr, ret+1, format, ap2); return ret; |