git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] print warning/error/fatal messages in one shot

From
Nicolas Pitre <nico@cam.org>
Date
Nov 9, 2007, 19:33 UTC
Message-ID
<alpine.LFD.0.9999.0711091430330.21255@xanadu.home>

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>
---
diff --git a/usage.c b/usage.c
index f5e652c..a5fc4ec 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)
Message 1 of 1 in “print warning/error/fatal messages in one shot”
  1. print warning/error/fatal messages in one shotNicolas Pitre, Nov 9, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.