]> mj.ucw.cz Git - libucw.git/blobdiff - lib/ff-printf.c
lib: added {big,page}_alloc_zero routines
[libucw.git] / lib / ff-printf.c
index aff49eb24de203606553f18edf4b81ae1da69c68..8825a2880437dff93a19e29b5e947d68b294a64b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     UCW Library -- Printf on Fastbuf Streams
  *
- *     (c) 2002 Martin Mares <mj@ucw.cz>
+ *     (c) 2002--2005 Martin Mares <mj@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU Lesser General Public License.
@@ -10,6 +10,7 @@
 #include "lib/lib.h"
 #include "lib/fastbuf.h"
 
+#include <stdio.h>
 #include <alloca.h>
 
 int
@@ -24,6 +25,7 @@ vbprintf(struct fastbuf *b, char *msg, va_list args)
     {
       va_copy(args2, args);
       r = vsnprintf(buf, len, msg, args2);
+      va_end(args2);
       if (r < 0)
        len = 256;
       else if (r < len)
@@ -42,6 +44,7 @@ vbprintf(struct fastbuf *b, char *msg, va_list args)
       buf = alloca(len);
       va_copy(args2, args);
       r = vsnprintf(buf, len, msg, args2);
+      va_end(args2);
       if (r < 0)
        len += len;
       else if (r < len)