Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-12-17 00:14:47 +0300
committerJunio C Hamano <gitster@pobox.com>2019-12-17 00:14:47 +0300
commite3b72391d1ab9fb55a8c22a06501d7a8d7c5e02a (patch)
tree6580eb37bd226e3b5caca3799e057da23616546e /builtin/commit.c
parent43bf44e23a784f640f339f0647a248eb1b926ee6 (diff)
parent147ee35558a300a7e51af5335ef59b09fd57ab7c (diff)
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 2db2ad0de4..e48c1fd90a 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);
}