sources/mystring.cpp

changeset 149
7643c21d546b
parent 148
19e98695e584
child 150
37db42ad451a
child 157
42bb29924218
equal deleted inserted replaced
148:19e98695e584 149:7643c21d546b
385 // Copy the argument list so that we have something to provide to vsnprintf in case we have to call it again. 385 // Copy the argument list so that we have something to provide to vsnprintf in case we have to call it again.
386 va_list argsCopy; 386 va_list argsCopy;
387 va_copy(argsCopy, args); 387 va_copy(argsCopy, args);
388 388
389 // First, attempt to format using a fixed-size buffer. 389 // First, attempt to format using a fixed-size buffer.
390 static char buffer[64]; 390 static char buffer[1024];
391 size_t length = vsnprintf(buffer, sizeof buffer, formatString, args); 391 size_t length = vsnprintf(buffer, sizeof buffer, formatString, args);
392 392
393 if (length < sizeof buffer) 393 if (length < sizeof buffer)
394 { 394 {
395 // vsnprintf succeeded in fitting the formatted string into the buffer, so we're done. 395 // vsnprintf succeeded in fitting the formatted string into the buffer, so we're done.

mercurial