summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-12-16 21:14:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-16 21:14:47 (GMT)
commite3b72391d1ab9fb55a8c22a06501d7a8d7c5e02a (patch)
tree6580eb37bd226e3b5caca3799e057da23616546e /builtin/commit.c
parent43bf44e23a784f640f339f0647a248eb1b926ee6 (diff)
parent147ee35558a300a7e51af5335ef59b09fd57ab7c (diff)
downloadgit-e3b72391d1ab9fb55a8c22a06501d7a8d7c5e02a.zip
git-e3b72391d1ab9fb55a8c22a06501d7a8d7c5e02a.tar.gz
git-e3b72391d1ab9fb55a8c22a06501d7a8d7c5e02a.tar.bz2
Merge branch 'rs/commit-export-env-simplify'
Code cleanup. * rs/commit-export-env-simplify: commit: use strbuf_add() to add a length-limited string
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 2db2ad0..e48c1fd 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -554,7 +554,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);
}