]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Modify to optionally use vsnprintf() when the system libc already
authorwessels <>
Tue, 21 Oct 1997 05:22:17 +0000 (05:22 +0000)
committerwessels <>
Tue, 21 Oct 1997 05:22:17 +0000 (05:22 +0000)
has snprintf()

lib/snprintf.c

index 1d854e3e2df3e08edd8152aec33640d933926ff9..48d8953ecb23d17e87cbd417e634a0321d3340e0 100644 (file)
@@ -54,7 +54,7 @@
  */
 
 
-#ifndef HAVE_SNPRINTF
+#if !HAVE_SNPRINTF || !HAVE_VSNPRINTF
 
 #include <stdio.h>
 #include <ctype.h>
@@ -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