@matheusbsbs / matheus-bagliano / commits / 88a667f063
Fork 0

builtin-receive-pack.c: fix compiler warnings about format string

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>

René Scharfe committed Feb 15, 2009 at 19:18 UTC 88a667f0630e8b9c7679127d3b9364447727e587
1 file changed +2 -2
builtin-receive-pack.c
+2 -2
@@ -244,7 +244,7 @@ static void warn_unconfigured_deny(void)
244 {
245 int i;
246 for (i = 0; i < ARRAY_SIZE(warn_unconfigured_deny_msg); i++)
247 - warning(warn_unconfigured_deny_msg[i]);
247 + warning("%s", warn_unconfigured_deny_msg[i]);
248 }
249
250 static char *warn_unconfigured_deny_delete_current_msg[] = {
@@ -270,7 +270,7 @@ static void warn_unconfigured_deny_delete_current(void)
270 for (i = 0;
271 i < ARRAY_SIZE(warn_unconfigured_deny_delete_current_msg);
272 i++)
273 - warning(warn_unconfigured_deny_delete_current_msg[i]);
273 + warning("%s", warn_unconfigured_deny_delete_current_msg[i]);
274 }
275
276 static const char *update(struct command *cmd)