summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2016-10-16 09:35:41 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2016-10-16 09:35:41 +0000
commita9d7e6fe079bbf46eefd5eaa866472609899499c (patch)
treec7df70e7664d1142d43c6aff88e95553765fb0cb /usr.sbin
parent187a6344e8079dbfeafbc650f3f35db527f4d77c (diff)
Add printf format attributes to the custom error functions.
ok natano
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/config/config.h11
-rw-r--r--usr.sbin/config/util.c5
2 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h
index 41aafc8fd17..b1802949710 100644
--- a/usr.sbin/config/config.h
+++ b/usr.sbin/config/config.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.h,v 1.28 2015/01/16 06:40:16 deraadt Exp $ */
+/* $OpenBSD: config.h,v 1.29 2016/10/16 09:35:40 tb Exp $ */
/* $NetBSD: config.h,v 1.30 1997/02/02 21:12:30 thorpej Exp $ */
/*
@@ -368,9 +368,12 @@ void *emalloc(size_t);
void *ereallocarray(void *, size_t, size_t);
void *ecalloc(size_t, size_t);
char *sourcepath(const char *);
-void error(const char *, ...); /* immediate errs */
-void xerror(const char *, int, const char *, ...); /* delayed errs */
-__dead void panic(const char *, ...);
+void error(const char *, ...) /* immediate errs */
+ __attribute__((__format__ (printf, 1, 2)));
+void xerror(const char *, int, const char *, ...) /* delayed errs */
+ __attribute__((__format__ (printf, 3, 4)));
+__dead void panic(const char *, ...)
+ __attribute__((__format__ (printf, 1, 2)));
struct nvlist *newnv(const char *, const char *, void *, int, struct nvlist *);
void nvfree(struct nvlist *);
void nvfreel(struct nvlist *);
diff --git a/usr.sbin/config/util.c b/usr.sbin/config/util.c
index 6fead74c31c..9d4db8c1dc2 100644
--- a/usr.sbin/config/util.c
+++ b/usr.sbin/config/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.17 2016/09/07 18:36:52 akfaew Exp $ */
+/* $OpenBSD: util.c,v 1.18 2016/10/16 09:35:40 tb Exp $ */
/* $NetBSD: util.c,v 1.5 1996/08/31 20:58:29 mycroft Exp $ */
/*
@@ -52,7 +52,8 @@
#include "config.h"
-static void vxerror(const char *, int, const char *, va_list);
+static void vxerror(const char *, int, const char *, va_list)
+ __attribute__((__format__ (printf, 3, 0)));
/*
* Malloc, with abort on error.