summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-27 10:45:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-27 10:45:27 +0000
commit5bea288f6608e242c7d157ce28a6859bb37d6e20 (patch)
tree244c7c4c0538b71133b44fce185b1853b28d0834 /lib/libc
parent5507d8e1c590b85bc9d7a51585295d6a2284f9fd (diff)
be very careful in case of signed chars
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdlib/strtod.c8
-rw-r--r--lib/libc/stdlib/strtol.c6
-rw-r--r--lib/libc/stdlib/strtoq.c4
-rw-r--r--lib/libc/stdlib/strtoul.c6
-rw-r--r--lib/libc/stdlib/strtouq.c4
5 files changed, 14 insertions, 14 deletions
diff --git a/lib/libc/stdlib/strtod.c b/lib/libc/stdlib/strtod.c
index f1c54639335..57db3d42b11 100644
--- a/lib/libc/stdlib/strtod.c
+++ b/lib/libc/stdlib/strtod.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: strtod.c,v 1.2 1996/03/19 23:15:11 niklas Exp $ */
-/* $NetBSD: strtod.c,v 1.21 1996/02/16 21:19:29 mark Exp $ */
+/* $OpenBSD: strtod.c,v 1.3 1996/07/27 10:45:23 deraadt Exp $ */
+/* $NetBSD: strtod.c,v 1.21.4.1 1996/07/20 01:14:54 jtc Exp $ */
/****************************************************************
*
@@ -93,7 +93,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: strtod.c,v 1.2 1996/03/19 23:15:11 niklas Exp $";
+static char *rcsid = "$OpenBSD: strtod.c,v 1.3 1996/07/27 10:45:23 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
@@ -1238,7 +1238,7 @@ strtod
rv = 0.;
- for(s = s00; isspace(*s); s++)
+ for(s = s00; isspace((unsigned char) *s); s++)
;
if (*s == '-') {
diff --git a/lib/libc/stdlib/strtol.c b/lib/libc/stdlib/strtol.c
index 021fdc0d2a4..6ca9e553b26 100644
--- a/lib/libc/stdlib/strtol.c
+++ b/lib/libc/stdlib/strtol.c
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strtol.c 5.4 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id: strtol.c,v 1.2 1995/12/21 14:58:36 deraadt Exp $";
+static char *rcsid = "$Id: strtol.c,v 1.3 1996/07/27 10:45:24 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <ctype.h>
@@ -66,7 +66,7 @@ strtol(nptr, endptr, base)
*/
s = nptr;
do {
- c = *s++;
+ c = (unsigned char) *s++;
} while (isspace(c));
if (c == '-') {
neg = 1;
@@ -112,7 +112,7 @@ strtol(nptr, endptr, base)
}
cutlim = -cutlim;
}
- for (acc = 0, any = 0;; c = *s++) {
+ for (acc = 0, any = 0;; c = (unsigned char) *s++) {
if (isdigit(c))
c -= '0';
else if (isalpha(c))
diff --git a/lib/libc/stdlib/strtoq.c b/lib/libc/stdlib/strtoq.c
index 003c020d719..0532f9f228c 100644
--- a/lib/libc/stdlib/strtoq.c
+++ b/lib/libc/stdlib/strtoq.c
@@ -66,7 +66,7 @@ strtoq(nptr, endptr, base)
*/
s = nptr;
do {
- c = *s++;
+ c = (unsigned char) *s++;
} while (isspace(c));
if (c == '-') {
neg = 1;
@@ -113,7 +113,7 @@ strtoq(nptr, endptr, base)
}
cutlim = -cutlim;
}
- for (acc = 0, any = 0;; c = *s++) {
+ for (acc = 0, any = 0;; c = (unsigned char) *s++) {
if (isdigit(c))
c -= '0';
else if (isalpha(c))
diff --git a/lib/libc/stdlib/strtoul.c b/lib/libc/stdlib/strtoul.c
index 1522bec5845..9d45c5cb9e6 100644
--- a/lib/libc/stdlib/strtoul.c
+++ b/lib/libc/stdlib/strtoul.c
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)strtoul.c 5.3 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id: strtoul.c,v 1.2 1995/12/21 14:58:38 deraadt Exp $";
+static char *rcsid = "$Id: strtoul.c,v 1.3 1996/07/27 10:45:25 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <ctype.h>
@@ -63,7 +63,7 @@ strtoul(nptr, endptr, base)
*/
s = nptr;
do {
- c = *s++;
+ c = (unsigned char) *s++;
} while (isspace(c));
if (c == '-') {
neg = 1;
@@ -84,7 +84,7 @@ strtoul(nptr, endptr, base)
cutoff = ULONG_MAX / (unsigned long)base;
cutlim = ULONG_MAX % (unsigned long)base;
- for (acc = 0, any = 0;; c = *s++) {
+ for (acc = 0, any = 0;; c = (unsigned char) *s++) {
if (isdigit(c))
c -= '0';
else if (isalpha(c))
diff --git a/lib/libc/stdlib/strtouq.c b/lib/libc/stdlib/strtouq.c
index 3ab2c232ddd..b872cf56f75 100644
--- a/lib/libc/stdlib/strtouq.c
+++ b/lib/libc/stdlib/strtouq.c
@@ -64,7 +64,7 @@ strtouq(nptr, endptr, base)
*/
s = nptr;
do {
- c = *s++;
+ c = (unsigned char) *s++;
} while (isspace(c));
if (c == '-') {
neg = 1;
@@ -85,7 +85,7 @@ strtouq(nptr, endptr, base)
cutoff = UQUAD_MAX / (u_quad_t)base;
cutlim = UQUAD_MAX % (u_quad_t)base;
- for (acc = 0, any = 0;; c = *s++) {
+ for (acc = 0, any = 0;; c = (unsigned char) *s++) {
if (isdigit(c))
c -= '0';
else if (isalpha(c))