summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2016-06-06 15:57:45 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2016-06-06 15:57:45 +0000
commit337e7f793336842ab15a256a96bd327258835ae4 (patch)
tree9c508071bac535c5bba35604f324c709a2508ab3 /usr.sbin
parenta3cf33ca8c2a6db0c2f97a8689bbaa2c178b98d3 (diff)
add format attributes to the proper functions and then fix the
warning in rde.c
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ospf6d/log.h26
-rw-r--r--usr.sbin/ospf6d/rde.c6
2 files changed, 20 insertions, 12 deletions
diff --git a/usr.sbin/ospf6d/log.h b/usr.sbin/ospf6d/log.h
index 0cc74030235..e51d6e8b2eb 100644
--- a/usr.sbin/ospf6d/log.h
+++ b/usr.sbin/ospf6d/log.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.h,v 1.8 2014/11/03 07:40:31 bluhm Exp $ */
+/* $OpenBSD: log.h,v 1.9 2016/06/06 15:57:44 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/ospf6d/rde.c b/usr.sbin/ospf6d/rde.c
index 1de5d140f40..8f06baf717b 100644
--- a/usr.sbin/ospf6d/rde.c
+++ b/usr.sbin/ospf6d/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.65 2015/12/05 13:12:41 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.66 2016/06/06 15:57:44 benno Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -356,7 +356,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
}
}
if (l != 0)
- log_warnx("rde_dispatch_imsg: peerid %lu, "
+ log_warnx("rde_dispatch_imsg: peerid %u, "
"trailing garbage in Database Description "
"packet", imsg.hdr.peerid);
@@ -387,7 +387,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
ntohs(v->lsa->hdr.len));
}
if (l != 0)
- log_warnx("rde_dispatch_imsg: peerid %lu, "
+ log_warnx("rde_dispatch_imsg: peerid %u, "
"trailing garbage in LS Request "
"packet", imsg.hdr.peerid);
break;