diff options
author | Sebastian Benoit <benno@cvs.openbsd.org> | 2016-07-18 21:20:32 +0000 |
---|---|---|
committer | Sebastian Benoit <benno@cvs.openbsd.org> | 2016-07-18 21:20:32 +0000 |
commit | b27a710ae4fb41fcda5b482bb9b3468295a7e185 (patch) | |
tree | 896372ade76f5613bba27248f0b17636e0ab78be /usr.sbin | |
parent | 2ab79d7b84981de56445ae12856b4564d77dcaaa (diff) |
add format attributes to log functions
ok florian@ claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ripd/log.h | 26 | ||||
-rw-r--r-- | usr.sbin/ripd/neighbor.c | 6 |
2 files changed, 20 insertions, 12 deletions
diff --git a/usr.sbin/ripd/log.h b/usr.sbin/ripd/log.h index d2961e252ac..98707c1fc8d 100644 --- a/usr.sbin/ripd/log.h +++ b/usr.sbin/ripd/log.h @@ -1,4 +1,4 @@ -/* $OpenBSD: log.h,v 1.3 2014/11/03 20:15:31 bluhm Exp $ */ +/* $OpenBSD: log.h,v 1.4 2016/07/18 21:20:31 benno Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -23,14 +23,22 @@ void log_init(int); void log_verbose(int); -void logit(int, const char *, ...); -void vlog(int, const char *, va_list); -void log_warn(const char *, ...); -void log_warnx(const char *, ...); -void log_info(const char *, ...); -void log_debug(const char *, ...); -void fatal(const char *) __dead; -void fatalx(const char *) __dead; +void logit(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +void vlog(int, const char *, va_list) + __attribute__((__format__ (printf, 2, 0))); +void log_warn(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void log_warnx(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void log_info(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void log_debug(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void fatal(const char *) __dead + __attribute__((__format__ (printf, 1, 0))); +void fatalx(const char *) __dead + __attribute__((__format__ (printf, 1, 0))); const char *if_type_name(enum iface_type); const char *nbr_state_name(int); diff --git a/usr.sbin/ripd/neighbor.c b/usr.sbin/ripd/neighbor.c index cedb527b727..29f5b893519 100644 --- a/usr.sbin/ripd/neighbor.c +++ b/usr.sbin/ripd/neighbor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: neighbor.c,v 1.9 2007/10/24 19:50:33 claudio Exp $ */ +/* $OpenBSD: neighbor.c,v 1.10 2016/07/18 21:20:31 benno Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -196,7 +196,7 @@ nbr_new(u_int32_t nbr_id, struct iface *iface) /* set event structures */ evtimer_set(&nbr->timeout_timer, nbr_timeout_timer, nbr); - log_debug("nbr_new: neighbor ID %s, peerid %lu", + log_debug("nbr_new: neighbor ID %s, peerid %u", inet_ntoa(nbr->id), nbr->peerid); return (nbr); @@ -211,7 +211,7 @@ nbr_act_del(struct nbr *nbr) nbr->state != NBR_STA_REQ_RCVD) nbr_failed_new(nbr); - log_debug("nbr_del: neighbor ID %s, peerid %lu", inet_ntoa(nbr->id), + log_debug("nbr_del: neighbor ID %s, peerid %u", inet_ntoa(nbr->id), nbr->peerid); /* stop timer */ |