summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/strtoimax.c6
-rw-r--r--lib/libc/stdlib/strtol.c6
-rw-r--r--lib/libc/stdlib/strtoll.c6
-rw-r--r--lib/libc/stdlib/strtoul.c6
-rw-r--r--lib/libc/stdlib/strtoull.c6
-rw-r--r--lib/libc/stdlib/strtoumax.c6
6 files changed, 18 insertions, 18 deletions
diff --git a/lib/libc/stdlib/strtoimax.c b/lib/libc/stdlib/strtoimax.c
index 52403a72134..74e355626af 100644
--- a/lib/libc/stdlib/strtoimax.c
+++ b/lib/libc/stdlib/strtoimax.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtoimax.c,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
+/* $OpenBSD: strtoimax.c,v 1.4 2017/07/06 16:23:11 millert Exp $ */
/*
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
@@ -74,8 +74,8 @@ strtoimax(const char *nptr, char **endptr, int base)
if (c == '+')
c = *s++;
}
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
+ if ((base == 0 || base == 16) && c == '0' &&
+ (*s == 'x' || *s == 'X') && isxdigit((unsigned char)s[1])) {
c = s[1];
s += 2;
base = 16;
diff --git a/lib/libc/stdlib/strtol.c b/lib/libc/stdlib/strtol.c
index 49465e28ee8..599d2355a89 100644
--- a/lib/libc/stdlib/strtol.c
+++ b/lib/libc/stdlib/strtol.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtol.c,v 1.11 2015/09/13 08:31:48 guenther Exp $ */
+/* $OpenBSD: strtol.c,v 1.12 2017/07/06 16:23:11 millert Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -75,8 +75,8 @@ strtol(const char *nptr, char **endptr, int base)
if (c == '+')
c = *s++;
}
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
+ if ((base == 0 || base == 16) && c == '0' &&
+ (*s == 'x' || *s == 'X') && isxdigit((unsigned char)s[1])) {
c = s[1];
s += 2;
base = 16;
diff --git a/lib/libc/stdlib/strtoll.c b/lib/libc/stdlib/strtoll.c
index 0ba51da77e8..d21a249a0b8 100644
--- a/lib/libc/stdlib/strtoll.c
+++ b/lib/libc/stdlib/strtoll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtoll.c,v 1.9 2015/09/13 08:31:48 guenther Exp $ */
+/* $OpenBSD: strtoll.c,v 1.10 2017/07/06 16:23:11 millert Exp $ */
/*
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
@@ -77,8 +77,8 @@ strtoll(const char *nptr, char **endptr, int base)
if (c == '+')
c = *s++;
}
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
+ if ((base == 0 || base == 16) && c == '0' &&
+ (*s == 'x' || *s == 'X') && isxdigit((unsigned char)s[1])) {
c = s[1];
s += 2;
base = 16;
diff --git a/lib/libc/stdlib/strtoul.c b/lib/libc/stdlib/strtoul.c
index 98e8abcbdba..6667bea8fac 100644
--- a/lib/libc/stdlib/strtoul.c
+++ b/lib/libc/stdlib/strtoul.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtoul.c,v 1.10 2015/09/13 08:31:48 guenther Exp $ */
+/* $OpenBSD: strtoul.c,v 1.11 2017/07/06 16:23:11 millert Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -69,8 +69,8 @@ strtoul(const char *nptr, char **endptr, int base)
if (c == '+')
c = *s++;
}
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
+ if ((base == 0 || base == 16) && c == '0' &&
+ (*s == 'x' || *s == 'X') && isxdigit((unsigned char)s[1])) {
c = s[1];
s += 2;
base = 16;
diff --git a/lib/libc/stdlib/strtoull.c b/lib/libc/stdlib/strtoull.c
index a5d07de6cff..d7733e40031 100644
--- a/lib/libc/stdlib/strtoull.c
+++ b/lib/libc/stdlib/strtoull.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtoull.c,v 1.8 2015/09/13 08:31:48 guenther Exp $ */
+/* $OpenBSD: strtoull.c,v 1.9 2017/07/06 16:23:11 millert Exp $ */
/*
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
@@ -71,8 +71,8 @@ strtoull(const char *nptr, char **endptr, int base)
if (c == '+')
c = *s++;
}
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
+ if ((base == 0 || base == 16) && c == '0' &&
+ (*s == 'x' || *s == 'X') && isxdigit((unsigned char)s[1])) {
c = s[1];
s += 2;
base = 16;
diff --git a/lib/libc/stdlib/strtoumax.c b/lib/libc/stdlib/strtoumax.c
index 4c5e3349f11..348184c1ac4 100644
--- a/lib/libc/stdlib/strtoumax.c
+++ b/lib/libc/stdlib/strtoumax.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtoumax.c,v 1.3 2015/09/12 16:23:14 guenther Exp $ */
+/* $OpenBSD: strtoumax.c,v 1.4 2017/07/06 16:23:11 millert Exp $ */
/*
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
@@ -68,8 +68,8 @@ strtoumax(const char *nptr, char **endptr, int base)
if (c == '+')
c = *s++;
}
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X')) {
+ if ((base == 0 || base == 16) && c == '0' &&
+ (*s == 'x' || *s == 'X') && isxdigit((unsigned char)s[1])) {
c = s[1];
s += 2;
base = 16;