From 7a54360cd4130f5891e178b6d33eb5b15398c721 Mon Sep 17 00:00:00 2001
From: Glenn L McGrath
Date: Sun, 27 Apr 2003 10:05:35 +0000
Subject: Use bb_xgetlarg

---
 coreutils/fold.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/coreutils/fold.c b/coreutils/fold.c
index f9ae526..df51107 100644
--- a/coreutils/fold.c
+++ b/coreutils/fold.c
@@ -97,15 +97,7 @@ extern int fold_main(int argc, char **argv)
 				break_spaces = 1;
 				break;
 			case 'w': {	/* Line width. */
-				long int tmp_long;
-				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;
+				width = bb_xgetlarg(optarg, 10, 1, 10000);
 				break;
 			}
 			default:
-- 
cgit v1.1