summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorSteve Price <steve@FreeBSD.org>1997-08-23 23:51:12 +0000
committerSteve Price <steve@FreeBSD.org>1997-08-23 23:51:12 +0000
commita89989b26f18285a92fb372157c8af79987599cb (patch)
tree85440e92192d3448c582b82f6138460f7df74108 /lib/libc
parent1e915c361efb9201ff291318b8554609bd940035 (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdlib/strtoll.c2
-rw-r--r--lib/libc/stdlib/strtoq.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/strtoll.c b/lib/libc/stdlib/strtoll.c
index 26667496f32d..f84e030531bb 100644
--- a/lib/libc/stdlib/strtoll.c
+++ b/lib/libc/stdlib/strtoll.c
@@ -105,7 +105,7 @@ strtoq(nptr, endptr, base)
* overflow.
*/
qbase = (unsigned)base;
- cutoff = neg ? -(u_quad_t)QUAD_MIN : QUAD_MAX;
+ cutoff = neg ? (u_quad_t)-(QUAD_MIN + QUAD_MAX) + QUAD_MAX : QUAD_MAX;
cutlim = cutoff % qbase;
cutoff /= qbase;
for (acc = 0, any = 0;; c = *s++) {
diff --git a/lib/libc/stdlib/strtoq.c b/lib/libc/stdlib/strtoq.c
index 26667496f32d..f84e030531bb 100644
--- a/lib/libc/stdlib/strtoq.c
+++ b/lib/libc/stdlib/strtoq.c
@@ -105,7 +105,7 @@ strtoq(nptr, endptr, base)
* overflow.
*/
qbase = (unsigned)base;
- cutoff = neg ? -(u_quad_t)QUAD_MIN : QUAD_MAX;
+ cutoff = neg ? (u_quad_t)-(QUAD_MIN + QUAD_MAX) + QUAD_MAX : QUAD_MAX;
cutlim = cutoff % qbase;
cutoff /= qbase;
for (acc = 0, any = 0;; c = *s++) {