{"thread":{"id":"43013","subject":"[PATCH] use strbuf_addstr() instead of strbuf_addf() with \"%s\"","startedAt":"2016-08-05T20:37:32Z","lastAt":"2016-08-07T08:49:41Z","messageCount":2,"participants":["René Scharfe","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"293229","messageId":"57A4F8F7.5020109@web.de","threadId":"43013","inReplyTo":null,"subject":"[PATCH] use strbuf_addstr() instead of strbuf_addf() with \"%s\"","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2016-08-05T20:37:11Z","receivedAt":"2016-08-05T20:37:32Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Call strbuf_addstr() for adding a simple string to a strbuf instead of\nusing the heavier strbuf_addf().  This is shorter and documents the\nintent more clearly.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n builtin/fmt-merge-msg.c | 2 +-\n http.c                  | 2 +-\n sequencer.c             | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c\nindex e5658c3..ac84e99 100644\n--- a/builtin/fmt-merge-msg.c\n+++ b/builtin/fmt-merge-msg.c\n@@ -272,7 +272,7 @@ static int cmp_string_list_util_as_integral(const void *a_, const void *b_)\n static void add_people_count(struct strbuf *out, struct string_list *people)\n {\n \tif (people->nr == 1)\n-\t\tstrbuf_addf(out, \"%s\", people->items[0].string);\n+\t\tstrbuf_addstr(out, people->items[0].string);\n \telse if (people->nr == 2)\n \t\tstrbuf_addf(out, \"%s (%d) and %s (%d)\",\n \t\t\t    people->items[0].string,\ndiff --git a/http.c b/http.c\nindex e81dd13..cd40b01 100644\n--- a/http.c\n+++ b/http.c\n@@ -1225,7 +1225,7 @@ void append_remote_object_url(struct strbuf *buf, const char *url,\n \n \tstrbuf_addf(buf, \"objects/%.*s/\", 2, hex);\n \tif (!only_two_digit_prefix)\n-\t\tstrbuf_addf(buf, \"%s\", hex+2);\n+\t\tstrbuf_addstr(buf, hex + 2);\n }\n \n char *get_remote_object_url(const char *url, const char *hex,\ndiff --git a/sequencer.c b/sequencer.c\nindex cdfac82..7b1eb14 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -112,7 +112,7 @@ static void remove_sequencer_state(void)\n {\n \tstruct strbuf seq_dir = STRBUF_INIT;\n \n-\tstrbuf_addf(&seq_dir, \"%s\", git_path(SEQ_DIR));\n+\tstrbuf_addstr(&seq_dir, git_path(SEQ_DIR));\n \tremove_dir_recursively(&seq_dir, 0);\n \tstrbuf_release(&seq_dir);\n }\n-- \n2.9.2\n\n"},{"id":"293316","messageId":"alpine.DEB.2.20.1608071048550.5786@virtualbox","threadId":"43013","inReplyTo":"57A4F8F7.5020109@web.de","subject":"Re: [PATCH] use strbuf_addstr() instead of strbuf_addf() with \"%s\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-08-07T08:49:27Z","receivedAt":"2016-08-07T08:49:41Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi René,\n\nOn Fri, 5 Aug 2016, René Scharfe wrote:\n\n> Call strbuf_addstr() for adding a simple string to a strbuf instead of\n> using the heavier strbuf_addf().  This is shorter and documents the\n> intent more clearly.\n\nLooks obviously good, thanks!\n\nCiao,\nDscho"}]}