len = vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
/* Deal with buffer overruns. Instead of panicking, just
* truncate the resulting string. Note that some vsnprintf()s
* return -1 on truncation, e.g., glibc 2.0.6 and earlier. */
len = vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
/* Deal with buffer overruns. Instead of panicking, just
* truncate the resulting string. Note that some vsnprintf()s
* return -1 on truncation, e.g., glibc 2.0.6 and earlier. */
const char ellipsis[] = "[...]";
/* Reset length, and zero-terminate the end of our buffer */
const char ellipsis[] = "[...]";
/* Reset length, and zero-terminate the end of our buffer */
len = vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);
len = vsnprintf(buf, sizeof(buf), format, ap);
va_end(ap);