summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2014-07-20 00:46:26 +0000
committerguenther <guenther@openbsd.org>2014-07-20 00:46:26 +0000
commit688df7cfa5f1c964f7a5d7a871dbd951df1d7467 (patch)
tree35e6fd70c567323bceb542ac34c911146d93bb60
parentFlense the telnet code base of unwanted ifdefs: authentication/encryption (diff)
downloadwireguard-openbsd-688df7cfa5f1c964f7a5d7a871dbd951df1d7467.tar.xz
wireguard-openbsd-688df7cfa5f1c964f7a5d7a871dbd951df1d7467.zip
Mark fatal() as printf-like.
Don't put a format string that's only used once in a variable.
-rw-r--r--sbin/newfs/newfs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index c38de189fb0..27e37a00dfb 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newfs.c,v 1.95 2013/11/22 04:12:48 deraadt Exp $ */
+/* $OpenBSD: newfs.c,v 1.96 2014/07/20 00:46:26 guenther Exp $ */
/* $NetBSD: newfs.c,v 1.20 1996/05/16 07:13:03 thorpej Exp $ */
/*
@@ -79,7 +79,9 @@ struct mntopt mopts[] = {
{ NULL },
};
-void fatal(const char *fmt, ...);
+void fatal(const char *fmt, ...)
+ __attribute__((__format__ (printf, 1, 2)))
+ __attribute__((__nonnull__ (1)));
__dead void usage(void);
void mkfs(struct partition *, char *, int, int, mode_t, uid_t, gid_t);
void rewritelabel(char *, int, struct disklabel *);
@@ -561,8 +563,6 @@ havelabel:
exit(0);
}
-char lmsg[] = "%s: can't read disk label; disk type must be specified";
-
struct disklabel *
getdisklabel(char *s, int fd)
{
@@ -579,7 +579,8 @@ getdisklabel(char *s, int fd)
return (lp);
}
warn("ioctl (GDINFO)");
- fatal(lmsg, s);
+ fatal("%s: can't read disk label; disk type must be specified",
+ s);
}
return (&lab);
}