diff options
author | 2015-09-27 16:56:06 +0000 | |
---|---|---|
committer | 2015-09-27 16:56:06 +0000 | |
commit | 8c63c13268086909bf9a168f87199fdf3bbe3e46 (patch) | |
tree | 1d5fbb56c54a32a2154463974cf107f272d7ec70 | |
parent | Fix bsd.rd upgrades over iwm(4), and fix `ifconfig iwm0 lladdr random`. (diff) | |
download | wireguard-openbsd-8c63c13268086909bf9a168f87199fdf3bbe3e46.tar.xz wireguard-openbsd-8c63c13268086909bf9a168f87199fdf3bbe3e46.zip |
Mark ask() as printf-like; split up a pwarn() with variable number of specifiers
ok beck@ millert@
-rw-r--r-- | sbin/fsck_msdos/ext.h | 4 | ||||
-rw-r--r-- | sbin/fsck_msdos/fat.c | 17 | ||||
-rw-r--r-- | sbin/fsck_msdos/main.c | 3 |
3 files changed, 12 insertions, 12 deletions
diff --git a/sbin/fsck_msdos/ext.h b/sbin/fsck_msdos/ext.h index 89529a65937..ace2b54cae6 100644 --- a/sbin/fsck_msdos/ext.h +++ b/sbin/fsck_msdos/ext.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ext.h,v 1.12 2014/07/09 18:32:34 tobias Exp $ */ +/* $OpenBSD: ext.h,v 1.13 2015/09/27 16:56:06 guenther Exp $ */ /* $NetBSD: ext.h,v 1.5 1997/10/17 11:19:48 ws Exp $ */ /* @@ -49,7 +49,7 @@ extern struct disklabel lab; /* * function declarations */ -int ask(int, const char *, ...); +int ask(int, const char *, ...) __attribute__((__format__ (printf, 2, 3))); /* * Check filesystem given as arg diff --git a/sbin/fsck_msdos/fat.c b/sbin/fsck_msdos/fat.c index 7df610d830a..38e32a94c6e 100644 --- a/sbin/fsck_msdos/fat.c +++ b/sbin/fsck_msdos/fat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fat.c,v 1.25 2014/07/10 20:11:12 tobias Exp $ */ +/* $OpenBSD: fat.c,v 1.26 2015/09/27 16:56:06 guenther Exp $ */ /* $NetBSD: fat.c,v 1.8 1997/10/17 11:19:53 ws Exp $ */ /* @@ -118,22 +118,23 @@ readfat(int fs, struct bootblock *boot, int no, struct fatEntry **fp) && ((buffer[3]&0x0f) != 0x0f || buffer[4] != 0xff || buffer[5] != 0xff || buffer[6] != 0xff || (buffer[7]&0x0f) != 0x0f))) { - char *msg; + static const char msg[] = "FAT starts with odd byte sequence "; switch (boot->ClustMask) { case CLUST32_MASK: - msg = "FAT starts with odd byte sequence (%02x%02x%02x%02x%02x%02x%02x%02x)\n"; + pwarn("%s(%02x%02x%02x%02x%02x%02x%02x%02x)\n", msg, + buffer[0], buffer[1], buffer[2], buffer[3], + buffer[4], buffer[5], buffer[6], buffer[7]); break; case CLUST16_MASK: - msg = "FAT starts with odd byte sequence (%02x%02x%02x%02x)\n"; + pwarn("%s(%02x%02x%02x%02x)\n", msg, + buffer[0], buffer[1], buffer[2], buffer[3]); break; default: - msg = "FAT starts with odd byte sequence (%02x%02x%02x)\n"; + pwarn("%s(%02x%02x%02x)\n", msg, + buffer[0], buffer[1], buffer[2]); break; } - pwarn(msg, - buffer[0], buffer[1], buffer[2], buffer[3], - buffer[4], buffer[5], buffer[6], buffer[7]); if (ask(1, "Correct")) ret |= FSFATMOD; } diff --git a/sbin/fsck_msdos/main.c b/sbin/fsck_msdos/main.c index 9ae7962b744..be75cb6c764 100644 --- a/sbin/fsck_msdos/main.c +++ b/sbin/fsck_msdos/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.19 2014/06/16 18:33:33 tobias Exp $ */ +/* $OpenBSD: main.c,v 1.20 2015/09/27 16:56:06 guenther Exp $ */ /* $NetBSD: main.c,v 1.8 1996/10/17 20:29:53 cgd Exp $ */ /* @@ -98,7 +98,6 @@ main(int argc, char *argv[]) exit(ret); } -/*VARARGS*/ int ask(int def, const char *fmt, ...) { |