From 94e97f19cd5505d455c4378a466e34b7aeced196 Mon Sep 17 00:00:00 2001 From: sin Date: Thu, 30 Jan 2014 13:54:16 +0000 Subject: [PATCH] No need to use enprintf() with EXIT_FAILURE eprintf() does just that. --- du.c | 2 +- mktemp.c | 2 +- util/recurse.c | 2 +- xargs.c | 10 ++++------ 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/du.c b/du.c index c6289cd..df7d3c0 100644 --- a/du.c +++ b/du.c @@ -151,7 +151,7 @@ du(const char *path) if (S_ISLNK(st.st_mode)) { if (snprintf(file, sizeof(file), "%s/%s", cwd, dent->d_name) >= sizeof(file)) - enprintf(EXIT_FAILURE, "path too long\n"); + eprintf("path too long\n"); } else { xrealpath(dent->d_name, file); } diff --git a/mktemp.c b/mktemp.c index 8cfd4c9..d2188d1 100644 --- a/mktemp.c +++ b/mktemp.c @@ -43,7 +43,7 @@ main(int argc, char *argv[]) tmpdir = p; if (snprintf(tmppath, sizeof(tmppath), "%s/%s", tmpdir, template) >= sizeof(tmppath)) - enprintf(EXIT_FAILURE, "path too long\n"); + eprintf("path too long\n"); if (dflag) { if (!mkdtemp(tmppath)) { if (!qflag) diff --git a/util/recurse.c b/util/recurse.c index 6ac235e..1db70d2 100644 --- a/util/recurse.c +++ b/util/recurse.c @@ -34,7 +34,7 @@ recurse(const char *path, void (*fn)(const char *)) while (--p >= buf && *p == '/') *p ='\0'; strlcat(buf, "/", sizeof(buf)); if (strlcat(buf, d->d_name, sizeof(buf)) >= sizeof(buf)) - enprintf(EXIT_FAILURE, "path too long\n"); + eprintf("path too long\n"); fn(buf); } diff --git a/xargs.c b/xargs.c index ce465ce..8e6ba61 100644 --- a/xargs.c +++ b/xargs.c @@ -78,7 +78,7 @@ main(int argc, char *argv[]) if (argsz + strlen(arg) + 1 > argmaxsz || i >= NARGS - 1) { if (strlen(arg) + 1 > argmaxsz) - enprintf(EXIT_FAILURE, "insufficient argument space\n"); + eprintf("insufficient argument space\n"); leftover = 1; break; } @@ -187,17 +187,15 @@ poparg(void) goto out; case '\'': if (parsequote('\'') == -1) - enprintf(EXIT_FAILURE, - "unterminated single quote\n"); + eprintf("unterminated single quote\n"); break; case '\"': if (parsequote('\"') == -1) - enprintf(EXIT_FAILURE, - "unterminated double quote\n"); + eprintf("unterminated double quote\n"); break; case '\\': if (parseescape() == -1) - enprintf(EXIT_FAILURE, "backslash at EOF\n"); + eprintf("backslash at EOF\n"); break; default: fillargbuf(ch);