OSDN Git Service

Fix non-literal format in printf-style calls
authorDaniel Lowe <dlowe@bitmuse.com>
Mon, 10 Nov 2008 21:07:52 +0000 (16:07 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Nov 2008 22:50:02 +0000 (14:50 -0800)
These were found using gcc 4.3.2-1ubuntu11 with the warning:

    warning: format not a string literal and no format arguments

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-check-attr.c
hash-object.c

index 4921341..15a04b7 100644 (file)
@@ -97,7 +97,7 @@ int cmd_check_attr(int argc, const char **argv, const char *prefix)
        else if (stdin_paths && doubledash < argc)
                errstr = "Can't specify files with --stdin";
        if (errstr) {
-               error (errstr);
+               error("%s", errstr);
                usage_with_options(check_attr_usage, check_attr_options);
        }
 
index 20937ff..846e91a 100644 (file)
@@ -110,7 +110,7 @@ int main(int argc, const char **argv)
        }
 
        if (errstr) {
-               error (errstr);
+               error("%s", errstr);
                usage_with_options(hash_object_usage, hash_object_options);
        }