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

[PATCH] Increase the size of the die/warning buffer to avoid truncation

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 24, 2009, 23:10 UTC
Message-ID
<20090324231035.GR23521@spearce.org>

Long messages like those from lockfile.c when a lock can't be obtained truncate with only 256 bytes in the message buffer. Bump it to 1024 to give more space for these longer cases.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 This works around the truncation I noticed in the error message
 from the second command in the sequence:
   $ git branch foo.lock
   $ git branch foo
 usage.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/usage.c b/usage.c
index 24f5fc0..820d09f 100644
--- a/usage.c
+++ b/usage.c
@@ -7,7 +7,7 @@
 
 static void report(const char *prefix, const char *err, va_list params)
 {
-	char msg[256];
+	char msg[1024];
 	vsnprintf(msg, sizeof(msg), err, params);
 	fprintf(stderr, "%s%s\n", prefix, msg);
 }
-- 
1.6.2.1.471.g682837
Message 1 of 1 in “Increase the size of the die/warning buffer to avoid truncation”
  1. Increase the size of the die/warning buffer to avoid truncationShawn O. Pearce, Mar 24, 2009

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.