summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-07-08 06:35:15 -0400
committerJunio C Hamano <gitster@pobox.com>2016-07-08 10:11:27 -0700
commitdabd35f4cdd8bcfa502d082da5a3e4b927a2b329 (patch)
treef99ce3fa8296289ea5b7c0b4751d9bde34a19327
parentfa262cac766d383c51e0ead04c62e114a79bd738 (diff)
downloadgit-dabd35f4cdd8bcfa502d082da5a3e4b927a2b329.tar.gz
avoid using sha1_to_hex output as printf format
We know that it should not contain any percent-signs, but it's a good habit not to feed non-literals to printf formatters. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/worktree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c
index e866844685..cce555cbbc 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -262,7 +262,7 @@ static int add_worktree(const char *path, const char *refname,
*/
strbuf_reset(&sb);
strbuf_addf(&sb, "%s/HEAD", sb_repo.buf);
- write_file(sb.buf, sha1_to_hex(null_sha1));
+ write_file(sb.buf, "%s", sha1_to_hex(null_sha1));
strbuf_reset(&sb);
strbuf_addf(&sb, "%s/commondir", sb_repo.buf);
write_file(sb.buf, "../..");