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/other/shred.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'toys/other/shred.c') diff --git a/toys/other/shred.c b/toys/other/shred.c index 64db5edf..5b018ea0 100644 --- a/toys/other/shred.c +++ b/toys/other/shred.c @@ -57,7 +57,7 @@ void shred_main(void) fd = open(*try, O_RDWR); } if (fd == -1) { - perror_msg("%s", *try); + perror_msg_raw(*try); continue; } @@ -84,7 +84,7 @@ void shred_main(void) if (pos < TT.offset) { if (TT.offset != lseek(fd, TT.offset, SEEK_SET)) { - perror_msg("%s", *try); + perror_msg_raw(*try); break; } pos = TT.offset; @@ -97,7 +97,7 @@ void shred_main(void) if (len-pos < throw) throw = len-pos; if (iter != TT.iterations) xread(TT.ufd, toybuf, throw); - if (throw != writeall(fd, toybuf, throw)) perror_msg("%s"); + if (throw != writeall(fd, toybuf, throw)) perror_msg_raw(*try); pos += throw; } if (toys.optflags & FLAG_u) -- cgit v1.2.3