X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/840f3008c2244ba8079512c68373ae9318f2cfeb..f486ea184ba1d605110eab4862406c11554ed13e:/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) {