summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2016-10-16 09:35:40 +0000
committertb <tb@openbsd.org>2016-10-16 09:35:40 +0000
commit41da4b048144c0ef07f1c056b08babefd50a9b97 (patch)
tree830924cd1875d4e628a36ca65525078c626d4309 /usr.sbin/config
parentRemove declarations for optarg and optind. They are declared in <unistd.h>. (diff)
downloadwireguard-openbsd-41da4b048144c0ef07f1c056b08babefd50a9b97.tar.xz
wireguard-openbsd-41da4b048144c0ef07f1c056b08babefd50a9b97.zip
Add printf format attributes to the custom error functions.
ok natano
Diffstat (limited to 'usr.sbin/config')
-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.