diff options
author | Jeff King <peff@peff.net> | 2016-07-08 13:35:15 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-08 20:11:27 +0300 |
commit | dabd35f4cdd8bcfa502d082da5a3e4b927a2b329 (patch) | |
tree | f99ce3fa8296289ea5b7c0b4751d9bde34a19327 | |
parent | fa262cac766d383c51e0ead04c62e114a79bd738 (diff) |
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.c | 2 |
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, "../.."); |