summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2016-06-06 15:56:23 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2016-06-06 15:56:23 +0000
commita3cf33ca8c2a6db0c2f97a8689bbaa2c178b98d3 (patch)
tree03ad7b75aeb1f529d5ecbd15dac80100760bed27 /usr.sbin/ospfd
parenta92311768ac837f5742a2e45ba5f5995ef1b4e27 (diff)
add format attributes to the proper functions and then fix the
warning in rde.c ok stsp@
Diffstat (limited to 'usr.sbin/ospfd')
-rw-r--r--usr.sbin/ospfd/log.h26
-rw-r--r--usr.sbin/ospfd/rde.c6
2 files changed, 20 insertions, 12 deletions
diff --git a/usr.sbin/ospfd/log.h b/usr.sbin/ospfd/log.h
index e0034e80324..656afd86a87 100644
--- a/usr.sbin/ospfd/log.h
+++ b/usr.sbin/ospfd/log.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.h,v 1.6 2014/11/03 07:40:31 bluhm Exp $ */
+/* $OpenBSD: log.h,v 1.7 2016/06/06 15:56:22 benno Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -23,13 +23,21 @@
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)));
#endif /* _LOG_H_ */
diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c
index 6d53eb3a953..3d2c9ae7fea 100644
--- a/usr.sbin/ospfd/rde.c
+++ b/usr.sbin/ospfd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.100 2015/12/05 12:20:13 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.101 2016/06/06 15:56:22 benno Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -374,7 +374,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
}
}
if (l != 0 && !error)
- log_warnx("rde_dispatch_imsg: peerid %lu, "
+ log_warnx("rde_dispatch_imsg: peerid %u, "
"trailing garbage in Database Description "
"packet", imsg.hdr.peerid);
@@ -411,7 +411,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;