diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2008-11-10 23:25:23 +0100 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2008-11-15 22:53:05 +0100 |
| commit | bd2db36b6cbbc04614e0444fbf652f0a24f8f3ac (patch) | |
| tree | 8914c91f90d3cbb970278f02e68115df1b2a6d17 | |
| parent | a1746ab2158da2324aefb7ce81e7b5edc9c41e79 (diff) | |
Another problem pointed out by clang
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);
^~~~~~~
| -rw-r--r-- | openbox/debug.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openbox/debug.c b/openbox/debug.c index 6b92c9ec..db18784c 100644 --- a/openbox/debug.c +++ b/openbox/debug.c @@ -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); } |
