From d3a435e53c94ec25b4ae5fa2614f49ef8884e08a Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 5 Jan 2016 22:26:58 -0600 Subject: Add error_msg_raw() and friends, replace error_msg("%s", s) uses, enable format checking, and fix up format checking complaints. Added out(type, value) function to stat to avoid a zillion printf typecasts. --- toys/lsb/killall.c | 2 +- toys/lsb/mknod.c | 2 +- toys/lsb/seq.c | 2 +- toys/lsb/umount.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'toys/lsb') diff --git a/toys/lsb/killall.c b/toys/lsb/killall.c index 3b316ecc..2772b432 100644 --- a/toys/lsb/killall.c +++ b/toys/lsb/killall.c @@ -94,7 +94,7 @@ void killall_main(void) if (TT.err[i]) { toys.exitval = 1; errno = TT.err[i]; - perror_msg("%s", TT.names[i]); + perror_msg_raw(TT.names[i]); } } if (CFG_TOYBOX_FREE) free(TT.err); diff --git a/toys/lsb/mknod.c b/toys/lsb/mknod.c index 39073fad..1a467b01 100644 --- a/toys/lsb/mknod.c +++ b/toys/lsb/mknod.c @@ -54,5 +54,5 @@ void mknod_main(void) if (-1 == lsm_set_create(TT.arg_context)) perror_exit("-Z '%s' failed", TT.arg_context); if (mknod(*toys.optargs, mode|modes[type], makedev(major, minor))) - perror_exit("%s", *toys.optargs); + perror_exit_raw(*toys.optargs); } diff --git a/toys/lsb/seq.c b/toys/lsb/seq.c index f1ca0d00..c6204742 100644 --- a/toys/lsb/seq.c +++ b/toys/lsb/seq.c @@ -47,7 +47,7 @@ static void insanitize(char *f) } // The @ is a byte offset, not utf8 chars. Waiting for somebody to complain... - if (*s || !found) error_exit("bad -f '%s'@%d", f, s-f+1); + if (*s || !found) error_exit("bad -f '%s'@%ld", f, s-f+1); } void seq_main(void) diff --git a/toys/lsb/umount.c b/toys/lsb/umount.c index c7998e41..e6994f19 100644 --- a/toys/lsb/umount.c +++ b/toys/lsb/umount.c @@ -101,7 +101,7 @@ static void do_umount(char *dir, char *dev, int flags) } } - perror_msg("%s", dir); + perror_msg_raw(dir); } void umount_main(void) -- cgit v1.2.3