aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-11-09 14:33:54 -0500
committerJunio C Hamano <gitster@pobox.com>2007-11-09 22:25:36 -0800
commitd048a96ee9bec968be0bdc9c43ffce61169545be (patch)
tree9f8f1a6812eedab4a7d219d8a9e1920beb25a115
parentb9217c09386e5313ac6a54cc91cf03149514154b (diff)
downloadgit-d048a96ee9bec968be0bdc9c43ffce61169545be.tar.gz
git-d048a96ee9bec968be0bdc9c43ffce61169545be.tar.xz
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>
-rw-r--r--usage.c6
1 files changed, 3 insertions, 3 deletions
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)