diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2003-04-27 10:05:35 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2003-04-27 10:05:35 +0000 |
commit | 7a54360cd4130f5891e178b6d33eb5b15398c721 (patch) | |
tree | 6af1c99a3492263676a6495a24eee3e980ba06b9 | |
parent | f01b805d9142bad42ebd8d0b4f6770bf06fb2cc3 (diff) | |
download | busybox-w32-7a54360cd4130f5891e178b6d33eb5b15398c721.tar.gz busybox-w32-7a54360cd4130f5891e178b6d33eb5b15398c721.tar.bz2 busybox-w32-7a54360cd4130f5891e178b6d33eb5b15398c721.zip |
Use bb_xgetlarg
-rw-r--r-- | coreutils/fold.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/coreutils/fold.c b/coreutils/fold.c index f9ae526df..df5110755 100644 --- a/coreutils/fold.c +++ b/coreutils/fold.c | |||
@@ -97,15 +97,7 @@ extern int fold_main(int argc, char **argv) | |||
97 | break_spaces = 1; | 97 | break_spaces = 1; |
98 | break; | 98 | break; |
99 | case 'w': { /* Line width. */ | 99 | case 'w': { /* Line width. */ |
100 | long int tmp_long; | 100 | width = bb_xgetlarg(optarg, 10, 1, 10000); |
101 | char *end_ptr; | ||
102 | |||
103 | errno = 0; | ||
104 | tmp_long = strtol(optarg, &end_ptr, 10); | ||
105 | if (!end_ptr || errno || tmp_long < 1) { | ||
106 | bb_error_msg_and_die("invalid number of columns: `%s'", optarg); | ||
107 | } | ||
108 | width = (int) tmp_long; | ||
109 | break; | 101 | break; |
110 | } | 102 | } |
111 | default: | 103 | default: |