X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fff-printf.c;h=0493092e6a0f4f57c482dee64f2f2abc0f43eb4d;hb=08ec58075cd87236ea502c2c3b89e38126478167;hp=aff49eb24de203606553f18edf4b81ae1da69c68;hpb=2bdb8362f6969384d1c2a4c0ee6bfef5e60e85c5;p=libucw.git diff --git a/lib/ff-printf.c b/lib/ff-printf.c index aff49eb2..0493092e 100644 --- a/lib/ff-printf.c +++ b/lib/ff-printf.c @@ -1,7 +1,7 @@ /* * UCW Library -- Printf on Fastbuf Streams * - * (c) 2002 Martin Mares + * (c) 2002--2005 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -10,10 +10,11 @@ #include "lib/lib.h" #include "lib/fastbuf.h" +#include #include int -vbprintf(struct fastbuf *b, char *msg, va_list args) +vbprintf(struct fastbuf *b, const char *msg, va_list args) { byte *buf; int len, r; @@ -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) @@ -55,7 +58,7 @@ vbprintf(struct fastbuf *b, char *msg, va_list args) } int -bprintf(struct fastbuf *b, char *msg, ...) +bprintf(struct fastbuf *b, const char *msg, ...) { va_list args; int res;