Error out if a single argument cannot fit into the argument space

This commit is contained in:
sin 2014-01-08 20:20:04 +00:00
parent e585133012
commit e96144118e

View File

@ -84,6 +84,8 @@ main(int argc, char *argv[])
while ((arg = poparg())) {
if (argsz + strlen(arg) + 1 > argmaxsz ||
i >= NARGS - 1) {
if (strlen(arg) + 1 > argmaxsz)
enprintf(EXIT_FAILURE, "insufficient argument space\n");
pusharg(arg);
break;
}