No need to use enprintf() with EXIT_FAILURE

eprintf() does just that.
This commit is contained in:
sin 2014-01-30 13:54:16 +00:00
parent b1b225c9ee
commit 94e97f19cd
4 changed files with 7 additions and 9 deletions

2
du.c
View File

@ -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);
}

View File

@ -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)

View File

@ -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);
}

10
xargs.c
View File

@ -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);