diff options
| author | dsl <dsl@NetBSD.org> | 2004-10-28 21:14:52 +0000 |
|---|---|---|
| committer | dsl <dsl@NetBSD.org> | 2004-10-28 21:14:52 +0000 |
| commit | 1793b7dd6985ad85d54c5aec3a0a439d9ef9e9f4 (patch) | |
| tree | 576153448c76d7e2e6b5839b40fc1c165add11d3 /lib/libc/stdlib | |
| parent | 31d993f26ac14f2646b05478c54ffa196870a738 (diff) | |
Use (unsigned char) cast to sanitise arguments to ctype functions.
Diffstat (limited to 'lib/libc/stdlib')
| -rw-r--r-- | lib/libc/stdlib/strtod.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/stdlib/strtod.c b/lib/libc/stdlib/strtod.c index 7061c89879b..3407666c7f7 100644 --- a/lib/libc/stdlib/strtod.c +++ b/lib/libc/stdlib/strtod.c @@ -1,4 +1,4 @@ -/* $NetBSD: strtod.c,v 1.43 2004/10/27 19:59:24 dsl Exp $ */ +/* $NetBSD: strtod.c,v 1.44 2004/10/28 21:14:52 dsl Exp $ */ /**************************************************************** * @@ -93,7 +93,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: strtod.c,v 1.43 2004/10/27 19:59:24 dsl Exp $"); +__RCSID("$NetBSD: strtod.c,v 1.44 2004/10/28 21:14:52 dsl Exp $"); #endif /* LIBC_SCCS and not lint */ #define Unsigned_Shifts @@ -1243,7 +1243,7 @@ strtod } /* "INF" or "INFINITY" */ - if (tolower(*s & 0xff) == 'i' && strncasecmp(s, "inf", 3) == 0) { + if (tolower((unsigned char)*s) == 'i' && strncasecmp(s, "inf", 3) == 0) { if (strncasecmp(s + 3, "inity", 5) == 0) s += 8; else @@ -1254,7 +1254,7 @@ strtod } /* "NAN" or "NAN(n-char-sequence-opt)" */ - if (tolower(*s & 0xff) == 'n' && strncasecmp(s, "nan", 3) == 0) { + if (tolower((unsigned char)*s) == 'n' && strncasecmp(s, "nan", 3) == 0) { #ifdef IEEE_Arith /* Build a quiet NaN. */ word0(rv) = Exp_mask | ((1 << Exp_shift) - 1); |
