diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-12-17 00:14:47 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-12-17 00:14:47 +0300 |
commit | e3b72391d1ab9fb55a8c22a06501d7a8d7c5e02a (patch) | |
tree | 6580eb37bd226e3b5caca3799e057da23616546e | |
parent | 43bf44e23a784f640f339f0647a248eb1b926ee6 (diff) | |
parent | 147ee35558a300a7e51af5335ef59b09fd57ab7c (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
-rw-r--r-- | builtin/commit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 2db2ad0de4c..e48c1fd90a8 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); } |