]> Dogcows Code - chaz/openbox/commitdiff
Another problem pointed out by clang
authorMikael Magnusson <mikachu@gmail.com>
Mon, 10 Nov 2008 22:25:23 +0000 (23:25 +0100)
committerMikael Magnusson <mikachu@gmail.com>
Sat, 15 Nov 2008 21:53:05 +0000 (22:53 +0100)
Using format specifiers without arguments in printf is still bad.

openbox/debug.c:105:18: warning: format string is not a string literal (potentially insecure)
    fprintf(out, log_domain);
                 ^~~~~~~~~~
openbox/debug.c:107:18: warning: format string is not a string literal (potentially insecure)
    fprintf(out, level);
                 ^~~~~
openbox/debug.c:109:18: warning: format string is not a string literal (potentially insecure)
    fprintf(out, message);
                 ^~~~~~~

openbox/debug.c

index 6b92c9ec9dd74f4aec81978282d3ef4e987cb142..db18784cc39342c2559b230a2d406599e55075a6 100644 (file)
@@ -102,11 +102,11 @@ void ob_debug_enable(ObDebugType type, gboolean enable)
 static inline void log_print(FILE *out, const gchar* log_domain,
                              const gchar *level, const gchar *message)
 {
-    fprintf(out, log_domain);
+    fprintf(out, "%s", log_domain);
     fprintf(out, "-");
-    fprintf(out, level);
+    fprintf(out, "%s", level);
     fprintf(out, ": ");
-    fprintf(out, message);
+    fprintf(out, "%s", message);
     fprintf(out, "\n");
     fflush(out);
 }
This page took 0.024996 seconds and 4 git commands to generate.