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

[PATCH] graph.c: fix padding

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 14, 2008, 14:22 UTC
Message-ID
<alpine.DEB.1.00.0805141522060.30431@racer>
There were two instances of "%*s" which want to be "%.*s" instead.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 graph.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/graph.c b/graph.c
index 9d6ed30..f3e2eed 100644
--- a/graph.c
+++ b/graph.c
@@ -422,7 +422,7 @@ static void graph_pad_horizontally(struct git_graph *graph, struct strbuf *sb)
 		return;
 
 	extra = graph->width - sb->len;
-	strbuf_addf(sb, "%*s", (int) extra, "");
+	strbuf_addf(sb, "%.*s", (int) extra, "");
 }
 
 static void graph_output_padding_line(struct git_graph *graph,
@@ -496,7 +496,7 @@ static void graph_output_pre_commit_line(struct git_graph *graph,
 		struct column *col = &graph->columns[i];
 		if (col->commit == graph->commit) {
 			seen_this = 1;
-			strbuf_addf(sb, "| %*s", graph->expansion_row, "");
+			strbuf_addf(sb, "| %.*s", graph->expansion_row, "");
 		} else if (seen_this) {
 			strbuf_addstr(sb, "\\ ");
 		} else {
-- 
1.5.5.1.375.g1becb
Next: Johannes Schindelin
Message 1 of 2 in “graph.c: fix padding”
  1. graph.c: fix paddingJohannes Schindelin, May 14, 2008
  2. Johannes SchindelinMay 15, 2008

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.