From 697a0c606e097fb85ea0ecbc59f47dbd23841872 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 28 Jan 2001 20:50:23 +0000 Subject: [PATCH] Added __attribute__((format...)) to declaration of log(), so that discrepancies between format string and arguments get easily found. --- lib/lib.h | 2 +- lib/log.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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; -- 2.39.5