From: Martin Mares Date: Sun, 28 Jan 2001 20:50:23 +0000 (+0000) Subject: Added __attribute__((format...)) to declaration of log(), so that X-Git-Tag: holmes-import~1566 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=697a0c606e097fb85ea0ecbc59f47dbd23841872;p=libucw.git Added __attribute__((format...)) to declaration of log(), so that discrepancies between format string and arguments get easily found. --- diff --git a/lib/lib.h b/lib/lib.h index 12d92e10..b397c89b 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -54,7 +54,7 @@ u32 temprand(uns); #define L_ERROR_R 'e' #define L_FATAL '!' /* die() */ -void log(unsigned int cat, byte *msg, ...); +void log(unsigned int cat, const char *msg, ...) __attribute__((format(printf,2,3))); void die(byte *, ...) NONRET; void log_init(byte *); void log_file(byte *); diff --git a/lib/log.c b/lib/log.c index f2440e80..bc74de5b 100644 --- a/lib/log.c +++ b/lib/log.c @@ -23,7 +23,7 @@ log_fork(void) } static void -vlog(unsigned int cat, byte *msg, va_list args) +vlog(unsigned int cat, const char *msg, va_list args) { time_t tim = time(NULL); struct tm *tm = localtime(&tim); @@ -41,7 +41,7 @@ vlog(unsigned int cat, byte *msg, va_list args) } void -log(unsigned int cat, byte *msg, ...) +log(unsigned int cat, const char *msg, ...) { va_list args;