summaryrefslogtreecommitdiff
path: root/sbin/modunload
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/modunload')
-rw-r--r--sbin/modunload/modunload.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/modunload/modunload.c b/sbin/modunload/modunload.c
index abffb35e49f..47634120dfe 100644
--- a/sbin/modunload/modunload.c
+++ b/sbin/modunload/modunload.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modunload.c,v 1.6 1998/11/18 10:43:04 art Exp $ */
+/* $OpenBSD: modunload.c,v 1.7 1998/11/18 16:06:43 deraadt Exp $ */
/* $NetBSD: modunload.c,v 1.9 1995/05/28 05:23:05 jtc Exp $ */
/*
@@ -81,7 +81,8 @@ main(argc, argv)
switch (c) {
case 'i':
modnum = strtol(optarg, &endptr, 0);
- if (*endptr != '\0')
+ if (modnum == LONG_MIN || modnum == LONG_MAX ||
+ *endptr != '\0')
errx(1, "not a valid number");
break; /* number */
case 'n':