a library function (e.g., snprintf()) can destroy it. Need to call va_copy() here.
len = bdirect_write_prepare(b, &buf);
if (len >= 16)
{
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);
if (r < 0)
len = 256;
else if (r < len)
if (r < 0)
len = 256;
else if (r < len)
while (1)
{
buf = alloca(len);
while (1)
{
buf = alloca(len);
- r = vsnprintf(buf, len, msg, args);
+ va_copy(args2, args);
+ r = vsnprintf(buf, len, msg, args2);
if (r < 0)
len += len;
else if (r < len)
if (r < 0)
len += len;
else if (r < len)