summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-09-30 17:48:23 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-09-30 17:48:23 +0000
commit1712168a6ac665f19edb6d85b784cf03df89d00b (patch)
tree37ee55661b3e83ab8c4a02cf12a744d2d4cb2c00 /sbin
parent2089d60b1455bbcc181a25b376999406ea4bccd8 (diff)
Clear errno before calling the strtol functions.
From Paul Stoeber <x0001 at x dot de1 dot cc>. OK deraadt@.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mount/getmntopts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/mount/getmntopts.c b/sbin/mount/getmntopts.c
index e6481539fdd..2ed2239b65b 100644
--- a/sbin/mount/getmntopts.c
+++ b/sbin/mount/getmntopts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getmntopts.c,v 1.9 2004/07/05 18:33:38 otto Exp $ */
+/* $OpenBSD: getmntopts.c,v 1.10 2006/09/30 17:48:22 ray Exp $ */
/* $NetBSD: getmntopts.c,v 1.3 1995/03/18 14:56:58 cgd Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)getmntopts.c 8.1 (Berkeley) 3/27/94";
#else
-static char rcsid[] = "$OpenBSD: getmntopts.c,v 1.9 2004/07/05 18:33:38 otto Exp $";
+static char rcsid[] = "$OpenBSD: getmntopts.c,v 1.10 2006/09/30 17:48:22 ray Exp $";
#endif
#endif /* not lint */
@@ -119,6 +119,7 @@ getmntopt(char **optionp, union mntval *valuep, const struct mntopt *m0,
/* Store the value for options with assignments in them. */
if (value != NULL) {
if (m->m_oflags & MFLAG_INTVAL) {
+ errno = 0;
l = strtol(value, &endp, 10);
if (endp == value || l < 0 || l > INT_MAX ||
(l == LONG_MAX && errno == ERANGE))