Skip to content

Commit 147ee35

Browse files
rscharfegitster
authored andcommitted
commit: use strbuf_add() to add a length-limited string
This is shorter and simpler. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b697d92 commit 147ee35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static void export_one(const char *var, const char *s, const char *e, int hack)
534534
struct strbuf buf = STRBUF_INIT;
535535
if (hack)
536536
strbuf_addch(&buf, hack);
537-
strbuf_addf(&buf, "%.*s", (int)(e - s), s);
537+
strbuf_add(&buf, s, e - s);
538538
setenv(var, buf.buf, 1);
539539
strbuf_release(&buf);
540540
}

0 commit comments

Comments
 (0)