aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-08-10 11:55:33 -0700
committerJunio C Hamano <gitster@pobox.com>2016-08-10 11:55:34 -0700
commit574a31b5b76b82b18e85825385d8594372152a8f (patch)
tree5a49cf8482dbd9f8d777bf0de1e350ed2268d266 /builtin
parent9a54075c80e8fb30fe267ac57d5e7ef652bc901f (diff)
parentbc57b9c0cc5a123365a922fa1831177e3fd607ed (diff)
downloadgit-574a31b5b76b82b18e85825385d8594372152a8f.tar.gz
git-574a31b5b76b82b18e85825385d8594372152a8f.tar.xz
Merge branch 'rs/use-strbuf-addstr' into maint
* rs/use-strbuf-addstr: use strbuf_addstr() instead of strbuf_addf() with "%s" use strbuf_addstr() for adding constant strings to a strbuf
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fmt-merge-msg.c2
-rw-r--r--builtin/rev-parse.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index e5658c320..ac84e99f3 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -272,7 +272,7 @@ static int cmp_string_list_util_as_integral(const void *a_, const void *b_)
static void add_people_count(struct strbuf *out, struct string_list *people)
{
if (people->nr == 1)
- strbuf_addf(out, "%s", people->items[0].string);
+ strbuf_addstr(out, people->items[0].string);
else if (people->nr == 2)
strbuf_addf(out, "%s (%d) and %s (%d)",
people->items[0].string,
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index c961b74c5..76cf05e2a 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -469,7 +469,7 @@ static int cmd_parseopt(int argc, const char **argv, const char *prefix)
(stop_at_non_option ? PARSE_OPT_STOP_AT_NON_OPTION : 0) |
PARSE_OPT_SHELL_EVAL);
- strbuf_addf(&parsed, " --");
+ strbuf_addstr(&parsed, " --");
sq_quote_argv(&parsed, argv, 0);
puts(parsed.buf);
return 0;