Skip to content

Commit

Permalink
revert: do not pass non-literal string as format to git_path()
Browse files Browse the repository at this point in the history
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 <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Nov 23, 2011
1 parent 017d1e1 commit b4524d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/revert.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b4524d3

Please sign in to comment.