Skip to content

Commit

Permalink
builtin-receive-pack.c: fix compiler warnings about format string
Browse files Browse the repository at this point in the history
While all of the strings passed to warning() are, in fact, literals, the
compiler doesn't recognize them as such because it doesn't see through
the loop used to iterate over them:

   builtin-receive-pack.c: In function 'warn_unconfigured_deny':
   builtin-receive-pack.c:247: warning: format not a string literal and no format arguments
   builtin-receive-pack.c: In function 'warn_unconfigured_deny_delete_current':
   builtin-receive-pack.c:273: warning: format not a string literal and no format arguments

Calm the compiler by adding easily recognizable format string literals.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
René Scharfe authored and Junio C Hamano committed Feb 15, 2009
1 parent 075394e commit 88a667f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builtin-receive-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static void warn_unconfigured_deny(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(warn_unconfigured_deny_msg); i++)
warning(warn_unconfigured_deny_msg[i]);
warning("%s", warn_unconfigured_deny_msg[i]);
}

static char *warn_unconfigured_deny_delete_current_msg[] = {
Expand All @@ -270,7 +270,7 @@ static void warn_unconfigured_deny_delete_current(void)
for (i = 0;
i < ARRAY_SIZE(warn_unconfigured_deny_delete_current_msg);
i++)
warning(warn_unconfigured_deny_delete_current_msg[i]);
warning("%s", warn_unconfigured_deny_delete_current_msg[i]);
}

static const char *update(struct command *cmd)
Expand Down

0 comments on commit 88a667f

Please sign in to comment.