Skip to content

Commit e3b7239

Browse files
committed
Merge branch 'rs/commit-export-env-simplify'
Code cleanup. * rs/commit-export-env-simplify: commit: use strbuf_add() to add a length-limited string
2 parents 43bf44e + 147ee35 commit e3b7239

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
@@ -554,7 +554,7 @@ static void export_one(const char *var, const char *s, const char *e, int hack)
554554
struct strbuf buf = STRBUF_INIT;
555555
if (hack)
556556
strbuf_addch(&buf, hack);
557-
strbuf_addf(&buf, "%.*s", (int)(e - s), s);
557+
strbuf_add(&buf, s, e - s);
558558
setenv(var, buf.buf, 1);
559559
strbuf_release(&buf);
560560
}

0 commit comments

Comments
 (0)