summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-09-15 18:31:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-15 19:23:38 (GMT)
commita22ae753cb297cb8a1e3ae950ae4415190cd51d5 (patch)
treefca5ed773d854629968db249065e162d9ad61682 /contrib
parent63f0a758a06f9af81717683185016275cb201190 (diff)
downloadgit-a22ae753cb297cb8a1e3ae950ae4415190cd51d5.zip
git-a22ae753cb297cb8a1e3ae950ae4415190cd51d5.tar.gz
git-a22ae753cb297cb8a1e3ae950ae4415190cd51d5.tar.bz2
use strbuf_addstr() for adding constant strings to a strbuf, part 2
Replace uses of strbuf_addf() for adding strings with more lightweight strbuf_addstr() calls. This makes the intent clearer and avoids potential issues with printf format specifiers. 02962d36845b89145cd69f8bc65e015d78ae3434 already converted six cases, this patch covers eleven more. A semantic patch for Coccinelle is included for easier checking for new cases that might be introduced in the future. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/coccinelle/strbuf.cocci5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/coccinelle/strbuf.cocci b/contrib/coccinelle/strbuf.cocci
new file mode 100644
index 0000000..7932d48
--- /dev/null
+++ b/contrib/coccinelle/strbuf.cocci
@@ -0,0 +1,5 @@
+@@
+expression E1, E2;
+@@
+- strbuf_addf(E1, E2);
++ strbuf_addstr(E1, E2);