From d8dfde947fbf2025a5644d62b1cde3542b262e5f Mon Sep 17 00:00:00 2001 From: Leonid Evdokimov Date: Thu, 21 May 2009 11:28:54 +0700 Subject: [PATCH] Fixed format string bug. --- log.c | 2 +- log.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/log.c b/log.c index 395b196..f60a3b9 100644 --- a/log.c +++ b/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; } diff --git a/log.h b/log.h index a3c419c..38987ca 100644 --- a/log.h +++ b/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={,}: */