From e51da5ecd24daeea1ec7ead50afbeb5fb137eaba Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 17 Aug 2009 19:46:28 +0200 Subject: [PATCH] Add missing argument in some call to LLOG_INFO in lldp.c. This fixes #17. Also add __attribute__ to log_* functions to let gcc automatically check for this. --- src/lldp.c | 1 + src/lldpd.h | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lldp.c b/src/lldp.c index 3fd56472..1ac88e1b 100644 --- a/src/lldp.c +++ b/src/lldp.c @@ -553,6 +553,7 @@ lldp_decode(struct lldpd *cfg, char *frame, int s, ((policy >> 24) > LLDPMED_APPTYPE_LAST)) { LLOG_INFO("unknown policy field %d " "received on %s", + policy, hardware->h_ifname); break; } diff --git a/src/lldpd.h b/src/lldpd.h index 796786c4..e752a5a5 100644 --- a/src/lldpd.h +++ b/src/lldpd.h @@ -412,13 +412,13 @@ char *dmi_asset(); /* log.c */ void log_init(int); -void log_warn(const char *, ...); +void log_warn(const char *, ...) __attribute__ ((format (printf, 1, 2))); #define LLOG_WARN(x,...) log_warn("%s: " x, __FUNCTION__, ##__VA_ARGS__) -void log_warnx(const char *, ...); +void log_warnx(const char *, ...) __attribute__ ((format (printf, 1, 2))); #define LLOG_WARNX(x,...) log_warnx("%s: " x, __FUNCTION__, ##__VA_ARGS__) -void log_info(const char *, ...); +void log_info(const char *, ...) __attribute__ ((format (printf, 1, 2))); #define LLOG_INFO(x,...) log_info("%s: " x, __FUNCTION__, ##__VA_ARGS__) -void log_debug(const char *, ...); +void log_debug(const char *, ...) __attribute__ ((format (printf, 1, 2))); #define LLOG_DEBUG(x,...) log_debug("%s: " x, __FUNCTION__, ##__VA_ARGS__) void fatal(const char *); void fatalx(const char *); -- 2.39.5