/*
* 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.
{
byte *buf;
int len, r;
+ va_list args2;
len = bdirect_write_prepare(b, &buf);
if (len >= 16)
{
- r = vsnprintf(buf, len, msg, args);
+ va_copy(args2, args);
+ r = vsnprintf(buf, len, msg, args2);
+ va_end(args2);
if (r < 0)
len = 256;
else if (r < len)
while (1)
{
buf = alloca(len);
- r = vsnprintf(buf, len, msg, args);
+ va_copy(args2, args);
+ r = vsnprintf(buf, len, msg, args2);
+ va_end(args2);
if (r < 0)
len += len;
else if (r < len)