From: wessels <> Date: Tue, 21 Oct 1997 05:22:17 +0000 (+0000) Subject: Modify to optionally use vsnprintf() when the system libc already X-Git-Tag: SQUID_3_0_PRE1~4754 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=727ff94267456205d3888b36488fb7a9070424de;p=thirdparty%2Fsquid.git Modify to optionally use vsnprintf() when the system libc already has snprintf() --- diff --git a/lib/snprintf.c b/lib/snprintf.c index 1d854e3e2d..48d8953ecb 100644 --- a/lib/snprintf.c +++ b/lib/snprintf.c @@ -54,7 +54,7 @@ */ -#ifndef HAVE_SNPRINTF +#if !HAVE_SNPRINTF || !HAVE_VSNPRINTF #include #include @@ -903,29 +903,28 @@ strx_printv(int *ccp, char *buf, size_t len, const char *format, if (ccp) *ccp = cc; } +#endif - +#if !HAVE_SNPRINTF int snprintf(char *buf, size_t len, const char *format,...) { int cc; va_list ap; - va_start(ap, format); strx_printv(&cc, buf, (len - 1), format, ap); va_end(ap); return (cc); } +#endif - +#if !HAVE_VSNPRINTF int vsnprintf(char *buf, size_t len, const char *format, va_list ap) { int cc; - strx_printv(&cc, buf, (len - 1), format, ap); return (cc); } - -#endif /* HAVE_SNPRINTF */ +#endif