fold: check -N form properly

This commit is contained in:
Hiltjo Posthuma 2015-05-19 23:43:58 +02:00 committed by sin
parent bc9205cab5
commit fbd128b564
1 changed files with 2 additions and 1 deletions

3
fold.c
View File

@ -85,7 +85,8 @@ main(int argc, char *argv[])
width = estrtonum(EARGF(usage()), 1, MIN(LLONG_MAX, SIZE_MAX));
break;
ARGNUM:
width = estrtonum(argv[0], 1, MIN(LLONG_MAX, SIZE_MAX));
if (!(width = ARGNUMF()))
eprintf("illegal width value, too small\n");
break;
default:
usage();