Error out if a single argument cannot fit into the argument space
This commit is contained in:
parent
e585133012
commit
e96144118e
2
xargs.c
2
xargs.c
|
@ -84,6 +84,8 @@ main(int argc, char *argv[])
|
||||||
while ((arg = poparg())) {
|
while ((arg = poparg())) {
|
||||||
if (argsz + strlen(arg) + 1 > argmaxsz ||
|
if (argsz + strlen(arg) + 1 > argmaxsz ||
|
||||||
i >= NARGS - 1) {
|
i >= NARGS - 1) {
|
||||||
|
if (strlen(arg) + 1 > argmaxsz)
|
||||||
|
enprintf(EXIT_FAILURE, "insufficient argument space\n");
|
||||||
pusharg(arg);
|
pusharg(arg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user