From 4376a74b614fbee7a581b1598e868a0464a0bf57 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 23 Aug 2023 14:14:13 -0500 Subject: Convert a few stray error_msg("%s", x) to error_msg_raw(x). --- toys/posix/file.c | 4 ++-- toys/posix/grep.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'toys/posix') diff --git a/toys/posix/file.c b/toys/posix/file.c index e48a5472..9428ecf4 100644 --- a/toys/posix/file.c +++ b/toys/posix/file.c @@ -210,7 +210,7 @@ static void do_regular_file(int fd, char *name) // zero through elf shnum, just in case memset(s, 0, 80); - if ((len = readall(fd, s, sizeof(toybuf)-8))<0) perror_msg("%s", name); + if ((len = readall(fd, s, sizeof(toybuf)-8))<0) perror_msg_raw(name); if (!len) xputs("empty"); // 45 bytes: https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html @@ -399,7 +399,7 @@ static void do_regular_file(int fd, char *name) } else { if (lseek(fd, ver_off - len + 0x200, SEEK_CUR)<0 || (len = readall(fd, s, sizeof(toybuf)))<0) - return perror_msg("%s", name); + return perror_msg_raw(name); } xprintf(", version %s\n", s); return; diff --git a/toys/posix/grep.c b/toys/posix/grep.c index 2f3c999d..c3734ced 100644 --- a/toys/posix/grep.c +++ b/toys/posix/grep.c @@ -136,7 +136,7 @@ static void do_grep(int fd, char *name) if (bin && FLAG(I)) return; } - if (!(file = fdopen(fd, "r"))) return perror_msg("%s", name); + if (!(file = fdopen(fd, "r"))) return perror_msg_raw(name); // Loop through lines of input for (;;) { @@ -150,7 +150,7 @@ static void do_grep(int fd, char *name) lcount++; errno = 0; ulen = len = getdelim(&line, &ulen, TT.delim, file); - if (len == -1 && errno) perror_msg("%s", name); + if (len == -1 && errno) perror_msg_raw(name); if (len<1) break; if (line[ulen-1] == TT.delim) line[--ulen] = 0; -- cgit v1.2.3