about summary refs log tree commit diff
path: root/src/usr.bin/jot/jot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr.bin/jot/jot.c')
-rw-r--r--src/usr.bin/jot/jot.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/usr.bin/jot/jot.c b/src/usr.bin/jot/jot.c
index 1f7aacd..99c1d66 100644
--- a/src/usr.bin/jot/jot.c
+++ b/src/usr.bin/jot/jot.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: jot.c,v 1.46 2018/06/24 18:39:57 schwarze Exp $	*/
+/*	$OpenBSD: jot.c,v 1.48 2018/08/01 13:35:33 tb Exp $	*/
 /*	$NetBSD: jot.c,v 1.3 1994/12/02 20:29:43 pk Exp $	*/
 
 /*-
@@ -128,7 +128,7 @@ main(int argc, char *argv[])
 	case 4:
 		if (!is_default(argv[3])) {
 			if (!sscanf(argv[3], "%lf", &step))
-				errx(1, "Bad s value:  %s", argv[3]);
+				errx(1, "Bad s value: %s", argv[3]);
 			mask |= STEP;
 			if (randomize)
 				warnx("random seeding not supported");
@@ -153,8 +153,10 @@ main(int argc, char *argv[])
 		}
 	case 1:
 		if (!is_default(argv[0])) {
-			if (!sscanf(argv[0], "%ld", &reps))
-				errx(1, "Bad reps value:  %s", argv[0]);
+			reps = strtonum(argv[0], 0, LONG_MAX, &errstr);
+			if (errstr != NULL)
+				errx(1, "Bad reps value, %s: %s", errstr,
+				    argv[0]);
 			mask |= REPS;
 			if (reps == 0)
 				infinity = true;