commit 94e97f19cd5505d455c4378a466e34b7aeced196
parent b1b225c9eea6ef3032602c049b7b7ebfec853de1
Author: sin <sin@2f30.org>
Date: Thu, 30 Jan 2014 13:54:16 +0000
No need to use enprintf() with EXIT_FAILURE
eprintf() does just that.
Diffstat:
4 files changed, 7 insertions(+), 9 deletions(-)
diff --git 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
@@ -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
@@ -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
@@ -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);