From: Nicolas Pitre Date: Fri, 9 Nov 2007 19:33:54 +0000 (-0500) Subject: print warning/error/fatal messages in one shot X-Git-Tag: v1.5.3.6~24 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d048a96e;p=git.git print warning/error/fatal messages in one shot Not doing so is likely to create a messed up display when sent over the sideband protocol. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- diff --git a/usage.c b/usage.c index f5e652cc7..a5fc4ec5f 100644 --- a/usage.c +++ b/usage.c @@ -7,9 +7,9 @@ static void report(const char *prefix, const char *err, va_list params) { - fputs(prefix, stderr); - vfprintf(stderr, err, params); - fputs("\n", stderr); + char msg[256]; + vsnprintf(msg, sizeof(msg), err, params); + fprintf(stderr, "%s%s\n", prefix, msg); } static NORETURN void usage_builtin(const char *err)