From b4524d343b085b63c68cf5e0a70007c19a048197 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Wed, 23 Nov 2011 19:45:36 +0700 Subject: [PATCH] revert: do not pass non-literal string as format to git_path() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes the following warning. CC builtin/revert.o builtin/revert.c: In function ‘write_cherry_pick_head’: builtin/revert.c:311: warning: format not a string literal and no format arguments Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/revert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/revert.c b/builtin/revert.c index 0c61668b8..9b9b2e574 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -308,7 +308,7 @@ static void write_cherry_pick_head(struct commit *commit, const char *pseudoref) strbuf_addf(&buf, "%s\n", sha1_to_hex(commit->object.sha1)); - filename = git_path(pseudoref); + filename = git_path("%s", pseudoref); fd = open(filename, O_WRONLY | O_CREAT, 0666); if (fd < 0) die_errno(_("Could not open '%s' for writing"), filename); -- 2.30.2