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>
Nicolas Pitre committed
Nov 9, 2007 at 14:33 UTC
d048a96ee9bec968be0bdc9c43ffce61169545be
1 file changed
+3
-3
usage.c
+3
-3
@@ -7,9 +7,9 @@
7
8
static void report(const char *prefix, const char *err, va_list params)
9
{
10
- fputs(prefix, stderr);
11
- vfprintf(stderr, err, params);
12
- fputs("\n", stderr);
10
+ char msg[256];
11
+ vsnprintf(msg, sizeof(msg), err, params);
12
+ fprintf(stderr, "%s%s\n", prefix, msg);
13
}
14
15
static NORETURN void usage_builtin(const char *err)