[BusyBox-cvs] busybox/coreutils fold.c,1.1,1.2

Glenn McGrath bug1 at busybox.net
Sun Apr 27 10:05:38 UTC 2003


Update of /var/cvs/busybox/coreutils
In directory winder:/tmp/cvs-serv13670/coreutils

Modified Files:
	fold.c 
Log Message:
Use bb_xgetlarg


Index: fold.c
===================================================================
RCS file: /var/cvs/busybox/coreutils/fold.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- fold.c	27 Apr 2003 06:02:13 -0000	1.1
+++ fold.c	27 Apr 2003 10:05:35 -0000	1.2
@@ -97,15 +97,7 @@
 				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:



More information about the busybox-cvs mailing list