Use bb_xgetlarg
This commit is contained in:
parent
f01b805d91
commit
7a54360cd4
@ -97,15 +97,7 @@ extern int fold_main(int argc, char **argv)
|
|||||||
break_spaces = 1;
|
break_spaces = 1;
|
||||||
break;
|
break;
|
||||||
case 'w': { /* Line width. */
|
case 'w': { /* Line width. */
|
||||||
long int tmp_long;
|
width = bb_xgetlarg(optarg, 10, 1, 10000);
|
||||||
char *end_ptr;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
tmp_long = strtol(optarg, &end_ptr, 10);
|
|
||||||
if (!end_ptr || errno || tmp_long < 1) {
|
|
||||||
bb_error_msg_and_die("invalid number of columns: `%s'", optarg);
|
|
||||||
}
|
|
||||||
width = (int) tmp_long;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user