add tests for gunzip
[oweals/busybox.git] / libbb / vdprintf.c
index ffcb7a444ebbbf61fc35bb7941f8ed30ae665950..726d56374d590ba5e7494a4fcdc55949b311db59 100644 (file)
@@ -7,19 +7,15 @@
  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
-#include <stdio.h>
-#include <unistd.h>
 #include "libbb.h"
 
-
-
-#if (__GLIBC__ < 2)
+#if defined(__GLIBC__) && __GLIBC__ < 2
 int vdprintf(int d, const char *format, va_list ap)
 {
        char buf[BUF_SIZE];
        int len;
 
-       len = vsprintf(buf, format, ap);
+       len = vsnprintf(buf, BUF_SIZE, format, ap);
        return write(d, buf, len);
 }
 #endif