From d048a96ee9bec968be0bdc9c43ffce61169545be Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Fri, 9 Nov 2007 14:33:54 -0500 Subject: [PATCH] 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 --- usage.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usage.c b/usage.c index f5e652cc76..a5fc4ec5fa 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) -- 2.43.2