=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/main.c,v retrieving revision 1.121 retrieving revision 1.122 diff -u -r1.121 -r1.122 --- src/usr.bin/make/main.c 2016/10/21 16:12:38 1.121 +++ src/usr.bin/make/main.c 2017/04/20 03:04:11 1.122 @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.121 2016/10/21 16:12:38 espie Exp $ */ +/* $OpenBSD: main.c,v 1.122 2017/04/20 03:04:11 dlg Exp $ */ /* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */ /* @@ -310,14 +310,14 @@ Lst_AtEnd(&makefiles, optarg); break; case 'j': { - char *endptr; + const char *errstr; forceJobs = true; - maxJobs = strtol(optarg, &endptr, 0); - if (endptr == optarg) { + maxJobs = strtonum(optarg, 1, INT_MAX, &errstr); + if (errstr != NULL) { fprintf(stderr, - "make: illegal argument to -j option -- %s -- not a number\n", - optarg); + "make: illegal argument to -j option" + " -- %s -- %s\n", optarg, errstr); usage(); } record_option(c, optarg);