X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/840f3008c2244ba8079512c68373ae9318f2cfeb..ad2f8275a5fc0dba29ca97bc02342d1f1627e590:/lib/log.c diff --git a/lib/log.c b/lib/log.c index 7b2ef3d..e0b741e 100644 --- a/lib/log.c +++ b/lib/log.c @@ -92,8 +92,10 @@ static void format(char buffer[], size_t bufsize, const char *fmt, va_list ap) { int ch; size_t n = 0; - if(byte_vsnprintf(t, sizeof t, fmt, ap) < 0) - strcpy(t, "[byte_vsnprintf failed]"); + if(byte_vsnprintf(t, sizeof t, fmt, ap) < 0) { + strcpy(t, "[byte_vsnprintf failed: "); + strncat(t, fmt, sizeof t - strlen(t) - 1); + } p = t; while((ch = (unsigned char)*p++)) { if(ch >= ' ' && ch <= 126) {