aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdtime
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1997-08-13 13:11:53 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1997-08-13 13:11:53 +0000
commitf38ea584f556b624bb677398aad9a93cb8a176f6 (patch)
tree296584bf52a2b49d91212ac813257de2ac031ef9 /lib/libc/stdtime
parent0b1885f9856f947e71cbca2f51857cb7120f6a22 (diff)
downloadsrc-f38ea584f556b624bb677398aad9a93cb8a176f6.tar.gz
src-f38ea584f556b624bb677398aad9a93cb8a176f6.zip
Add unsigned char cast to all ctype calls
Notes
Notes: svn path=/head/; revision=28164
Diffstat (limited to 'lib/libc/stdtime')
-rw-r--r--lib/libc/stdtime/strptime.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c
index 088084849458..1158b254b950 100644
--- a/lib/libc/stdtime/strptime.c
+++ b/lib/libc/stdtime/strptime.c
@@ -53,7 +53,7 @@
#ifdef LIBC_RCS
static const char rcsid[] =
- "$Id$";
+ "$Id: strptime.c,v 1.2 1997/08/09 15:43:56 joerg Exp $";
#endif
#ifndef lint
@@ -87,8 +87,8 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
c = *ptr++;
if (c != '%') {
- if (isspace(c))
- while (*buf != 0 && isspace(*buf))
+ if (isspace((unsigned char)c))
+ while (*buf != 0 && isspace((unsigned char)*buf))
buf++;
else if (c != *buf++)
return 0;
@@ -152,10 +152,10 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
break;
case 'j':
- if (!isdigit(*buf))
+ if (!isdigit((unsigned char)*buf))
return 0;
- for (i = 0; *buf != 0 && isdigit(*buf); buf++) {
+ for (i = 0; *buf != 0 && isdigit((unsigned char)*buf); buf++) {
i *= 10;
i += *buf - '0';
}
@@ -167,13 +167,13 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
case 'M':
case 'S':
- if (*buf == 0 || isspace(*buf))
+ if (*buf == 0 || isspace((unsigned char)*buf))
break;
- if (!isdigit(*buf))
+ if (!isdigit((unsigned char)*buf))
return 0;
- for (i = 0; *buf != 0 && isdigit(*buf); buf++) {
+ for (i = 0; *buf != 0 && isdigit((unsigned char)*buf); buf++) {
i *= 10;
i += *buf - '0';
}
@@ -185,8 +185,8 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
else
tm->tm_sec = i;
- if (*buf != 0 && isspace(*buf))
- while (*ptr != 0 && !isspace(*ptr))
+ if (*buf != 0 && isspace((unsigned char)*buf))
+ while (*ptr != 0 && !isspace((unsigned char)*ptr))
ptr++;
break;
@@ -194,10 +194,10 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
case 'I':
case 'k':
case 'l':
- if (!isdigit(*buf))
+ if (!isdigit((unsigned char)*buf))
return 0;
- for (i = 0; *buf != 0 && isdigit(*buf); buf++) {
+ for (i = 0; *buf != 0 && isdigit((unsigned char)*buf); buf++) {
i *= 10;
i += *buf - '0';
}
@@ -209,8 +209,8 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
tm->tm_hour = i;
- if (*buf != 0 && isspace(*buf))
- while (*ptr != 0 && !isspace(*ptr))
+ if (*buf != 0 && isspace((unsigned char)*buf))
+ while (*ptr != 0 && !isspace((unsigned char)*ptr))
ptr++;
break;
@@ -261,10 +261,10 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
case 'd':
case 'e':
- if (!isdigit(*buf))
+ if (!isdigit((unsigned char)*buf))
return 0;
- for (i = 0; *buf != 0 && isdigit(*buf); buf++) {
+ for (i = 0; *buf != 0 && isdigit((unsigned char)*buf); buf++) {
i *= 10;
i += *buf - '0';
}
@@ -273,8 +273,8 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
tm->tm_mday = i;
- if (*buf != 0 && isspace(*buf))
- while (*ptr != 0 && !isspace(*ptr))
+ if (*buf != 0 && isspace((unsigned char)*buf))
+ while (*ptr != 0 && !isspace((unsigned char)*ptr))
ptr++;
break;
@@ -302,10 +302,10 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
break;
case 'm':
- if (!isdigit(*buf))
+ if (!isdigit((unsigned char)*buf))
return 0;
- for (i = 0; *buf != 0 && isdigit(*buf); buf++) {
+ for (i = 0; *buf != 0 && isdigit((unsigned char)*buf); buf++) {
i *= 10;
i += *buf - '0';
}
@@ -314,20 +314,20 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
tm->tm_mon = i - 1;
- if (*buf != 0 && isspace(*buf))
- while (*ptr != 0 && !isspace(*ptr))
+ if (*buf != 0 && isspace((unsigned char)*buf))
+ while (*ptr != 0 && !isspace((unsigned char)*ptr))
ptr++;
break;
case 'Y':
case 'y':
- if (*buf == 0 || isspace(*buf))
+ if (*buf == 0 || isspace((unsigned char)*buf))
break;
- if (!isdigit(*buf))
+ if (!isdigit((unsigned char)*buf))
return 0;
- for (i = 0; *buf != 0 && isdigit(*buf); buf++) {
+ for (i = 0; *buf != 0 && isdigit((unsigned char)*buf); buf++) {
i *= 10;
i += *buf - '0';
}
@@ -338,8 +338,8 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
tm->tm_year = i;
- if (*buf != 0 && isspace(*buf))
- while (*ptr != 0 && !isspace(*ptr))
+ if (*buf != 0 && isspace((unsigned char)*buf))
+ while (*ptr != 0 && !isspace((unsigned char)*ptr))
ptr++;
break;
}