{"thread":{"id":"17804","subject":"[PATCH] builtin-receive-pack.c: fix compiler warnings about format string","startedAt":"2009-02-15T18:18:58Z","lastAt":"2009-02-15T19:34:03Z","messageCount":2,"participants":["René Scharfe","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"104794","messageId":"1234721938.17613.21.camel@ubuntu.ubuntu-domain","threadId":"17804","inReplyTo":null,"subject":"[PATCH] builtin-receive-pack.c: fix compiler warnings about format string","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2009-02-15T18:18:58Z","receivedAt":"2009-02-15T18:18:58Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"While all of the strings passed to warning() are, in fact, literals, the\ncompiler doesn't recognize them as such because it doesn't see through\nthe loop used to iterate over them:\n\n   builtin-receive-pack.c: In function 'warn_unconfigured_deny':\n   builtin-receive-pack.c:247: warning: format not a string literal and no format arguments\n   builtin-receive-pack.c: In function 'warn_unconfigured_deny_delete_current':\n   builtin-receive-pack.c:273: warning: format not a string literal and no format arguments\n\nCalm the compiler by adding easily recognizable format string literals.\n\nSigned-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n builtin-receive-pack.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-receive-pack.c b/builtin-receive-pack.c\nindex f7e04c4..849f1fe 100644\n--- a/builtin-receive-pack.c\n+++ b/builtin-receive-pack.c\n@@ -244,7 +244,7 @@ static void warn_unconfigured_deny(void)\n {\n \tint i;\n \tfor (i = 0; i < ARRAY_SIZE(warn_unconfigured_deny_msg); i++)\n-\t\twarning(warn_unconfigured_deny_msg[i]);\n+\t\twarning(\"%s\", warn_unconfigured_deny_msg[i]);\n }\n \n static char *warn_unconfigured_deny_delete_current_msg[] = {\n@@ -270,7 +270,7 @@ static void warn_unconfigured_deny_delete_current(void)\n \tfor (i = 0;\n \t     i < ARRAY_SIZE(warn_unconfigured_deny_delete_current_msg);\n \t     i++)\n-\t\twarning(warn_unconfigured_deny_delete_current_msg[i]);\n+\t\twarning(\"%s\", warn_unconfigured_deny_delete_current_msg[i]);\n }\n \n static const char *update(struct command *cmd)\n"},{"id":"104807","messageId":"7v3aeflck4.fsf@gitster.siamese.dyndns.org","threadId":"17804","inReplyTo":"1234721938.17613.21.camel@ubuntu.ubuntu-domain","subject":"Re: [PATCH] builtin-receive-pack.c: fix compiler warnings about format string","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-15T19:34:03Z","receivedAt":"2009-02-15T19:34:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}