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 <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nicolas Pitre 2007-11-09 14:33:54 -05:00 committed by Junio C Hamano
parent b9217c0938
commit d048a96ee9

View File

@ -7,9 +7,9 @@
static void report(const char *prefix, const char *err, va_list params) static void report(const char *prefix, const char *err, va_list params)
{ {
fputs(prefix, stderr); char msg[256];
vfprintf(stderr, err, params); vsnprintf(msg, sizeof(msg), err, params);
fputs("\n", stderr); fprintf(stderr, "%s%s\n", prefix, msg);
} }
static NORETURN void usage_builtin(const char *err) static NORETURN void usage_builtin(const char *err)