Permalink
Browse files

Fixed format string bug.

  • Loading branch information...
1 parent 77a4904 commit d8dfde947fbf2025a5644d62b1cde3542b262e5f @darkk committed May 21, 2009
Showing with 7 additions and 2 deletions.
  1. +1 −1 log.c
  2. +6 −1 log.h
View
2 log.c
@@ -81,7 +81,7 @@ int log_preopen(const char *dst, bool log_debug, bool log_info)
break;
}
if (facility == -1) {
- log_error(LOG_ERR, "log_preopen(%s, ...): unknown syslog facility");
+ log_error(LOG_ERR, "log_preopen(%s, ...): unknown syslog facility", dst);
return -1;
}
View
7 log.h
@@ -12,7 +12,12 @@ int log_preopen(const char *dst, bool log_debug, bool log_info);
void log_open();
void _log_vwrite(const char *file, int line, const char *func, int do_errno, int priority, const char *fmt, va_list ap);
-void _log_write(const char *file, int line, const char *func, int do_errno, int priority, const char *fmt, ...);
+
+void _log_write(const char *file, int line, const char *func, int do_errno, int priority, const char *fmt, ...)
+#if defined(__GNUC__)
+ __attribute__ (( format (printf, 6, 7) ))
+#endif
+;
/* vim:set tabstop=4 softtabstop=4 shiftwidth=4: */
/* vim:set foldmethod=marker foldlevel=32 foldmarker={,}: */

0 comments on commit d8dfde9

Please sign in to comment.