summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbenno <benno@openbsd.org>2016-07-18 21:14:30 +0000
committerbenno <benno@openbsd.org>2016-07-18 21:14:30 +0000
commit3d8a8be32e75cf6d0e9df7ddf069368039c00f8d (patch)
tree33bb8fea8aa7ee01ca93f554eaf48c997f44f790
parentadd format attributes to log functions and fix am error when using (diff)
downloadwireguard-openbsd-3d8a8be32e75cf6d0e9df7ddf069368039c00f8d.tar.xz
wireguard-openbsd-3d8a8be32e75cf6d0e9df7ddf069368039c00f8d.zip
add format attributes to log functions and fix two errors
ok renato@
-rw-r--r--usr.sbin/eigrpd/log.h26
-rw-r--r--usr.sbin/eigrpd/tlv.c6
2 files changed, 20 insertions, 12 deletions
diff --git a/usr.sbin/eigrpd/log.h b/usr.sbin/eigrpd/log.h
index c2c1a4e9eef..cfd1eac4a19 100644
--- a/usr.sbin/eigrpd/log.h
+++ b/usr.sbin/eigrpd/log.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.h,v 1.2 2016/04/15 13:10:56 renato Exp $ */
+/* $OpenBSD: log.h,v 1.3 2016/07/18 21:14:30 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 *log_in6addr(const struct in6_addr *);
const char *log_in6addr_scope(const struct in6_addr *, unsigned int);
diff --git a/usr.sbin/eigrpd/tlv.c b/usr.sbin/eigrpd/tlv.c
index 339bf9b31d1..6c0d97f1bcd 100644
--- a/usr.sbin/eigrpd/tlv.c
+++ b/usr.sbin/eigrpd/tlv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tlv.c,v 1.11 2016/02/21 18:59:54 renato Exp $ */
+/* $OpenBSD: tlv.c,v 1.12 2016/07/18 21:14:30 benno Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@@ -300,13 +300,13 @@ tlv_decode_seq(int af, struct tlv *tlv, char *buf,
switch (af) {
case AF_INET:
if (alen != INADDRSZ) {
- log_debug("%s: invalid address length");
+ log_debug("%s: invalid address length", __func__);
return (-1);
}
break;
case AF_INET6:
if (alen != IN6ADDRSZ) {
- log_debug("%s: invalid address length");
+ log_debug("%s: invalid address length", __func__);
return (-1);
}
break;