summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-12-07 11:16:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-09 19:25:27 (GMT)
commit147ee35558a300a7e51af5335ef59b09fd57ab7c (patch)
treea547d8ea1d50748344e587659375712488391433 /builtin/commit.c
parentb697d92f56511e804b8ba20ccbe7bdc85dc66810 (diff)
downloadgit-147ee35558a300a7e51af5335ef59b09fd57ab7c.zip
git-147ee35558a300a7e51af5335ef59b09fd57ab7c.tar.gz
git-147ee35558a300a7e51af5335ef59b09fd57ab7c.tar.bz2
commit: use strbuf_add() to add a length-limited string
This is shorter and simpler. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 1c9e8e2..599fd10 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -534,7 +534,7 @@ static void export_one(const char *var, const char *s, const char *e, int hack)
struct strbuf buf = STRBUF_INIT;
if (hack)
strbuf_addch(&buf, hack);
- strbuf_addf(&buf, "%.*s", (int)(e - s), s);
+ strbuf_add(&buf, s, e - s);
setenv(var, buf.buf, 1);
strbuf_release(&buf);
}