diff options
author | florian <florian@openbsd.org> | 2016-09-04 14:39:32 +0000 |
---|---|---|
committer | florian <florian@openbsd.org> | 2016-09-04 14:39:32 +0000 |
commit | f7986388bb8a2af59d2014605f17621cae60b134 (patch) | |
tree | a411194ef9f8d6bdac5c1fa48a3c18651680c85e /usr.sbin/identd | |
parent | minor bump for SHA512/256 API additions; ok tedu@ deraadt@ (diff) | |
download | wireguard-openbsd-f7986388bb8a2af59d2014605f17621cae60b134.tar.xz wireguard-openbsd-f7986388bb8a2af59d2014605f17621cae60b134.zip |
Add format attribute to logger functions.
Input & OK benno@
Diffstat (limited to 'usr.sbin/identd')
-rw-r--r-- | usr.sbin/identd/identd.c | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/usr.sbin/identd/identd.c b/usr.sbin/identd/identd.c index 377a84c3940..aba8ddc2697 100644 --- a/usr.sbin/identd/identd.c +++ b/usr.sbin/identd/identd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: identd.c,v 1.33 2015/10/24 15:31:00 jca Exp $ */ +/* $OpenBSD: identd.c,v 1.34 2016/09/04 14:39:32 florian Exp $ */ /* * Copyright (c) 2013 David Gwynne <dlg@openbsd.org> @@ -132,12 +132,18 @@ const char *getport(struct sockaddr_storage *); const char *gentoken(void); struct loggers { - void (*err)(int, const char *, ...); - void (*errx)(int, const char *, ...); - void (*warn)(const char *, ...); - void (*warnx)(const char *, ...); - void (*notice)(const char *, ...); - void (*debug)(const char *, ...); + __dead void (*err)(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); + __dead void (*errx)(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); + void (*warn)(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); + void (*warnx)(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); + void (*notice)(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); + void (*debug)(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); }; const struct loggers conslogger = { @@ -149,13 +155,20 @@ const struct loggers conslogger = { warnx /* debug */ }; -void syslog_err(int, const char *, ...); -void syslog_errx(int, const char *, ...); -void syslog_warn(const char *, ...); -void syslog_warnx(const char *, ...); -void syslog_notice(const char *, ...); -void syslog_debug(const char *, ...); -void syslog_vstrerror(int, int, const char *, va_list); +__dead void syslog_err(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__dead void syslog_errx(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +void syslog_warn(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void syslog_warnx(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void syslog_notice(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void syslog_debug(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void syslog_vstrerror(int, int, const char *, va_list) + __attribute__((__format__ (printf, 3, 0))); const struct loggers syslogger = { syslog_err, |