Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin Add (unsigned char) cast to ctype functions
details: https://anonhg.NetBSD.org/src/rev/974d1a44ef3b
branches: trunk
changeset: 570828:974d1a44ef3b
user: dsl <dsl%NetBSD.org@localhost>
date: Sat Oct 30 15:04:45 2004 +0000
description:
Add (unsigned char) cast to ctype functions
diffstat:
usr.sbin/pkg_install/lib/ftpio.c | 24 ++++++++++++------------
usr.sbin/pkg_install/lib/str.c | 16 ++++++++--------
usr.sbin/pppd/pppd/chap_ms.c | 6 +++---
usr.sbin/pvctxctl/pvctxctl.c | 4 ++--
4 files changed, 25 insertions(+), 25 deletions(-)
diffs (203 lines):
diff -r 97559058b478 -r 974d1a44ef3b usr.sbin/pkg_install/lib/ftpio.c
--- a/usr.sbin/pkg_install/lib/ftpio.c Sat Oct 30 15:01:32 2004 +0000
+++ b/usr.sbin/pkg_install/lib/ftpio.c Sat Oct 30 15:04:45 2004 +0000
@@ -1,8 +1,8 @@
-/* $NetBSD: ftpio.c,v 1.62 2003/12/20 03:31:56 grant Exp $ */
+/* $NetBSD: ftpio.c,v 1.63 2004/10/30 15:04:45 dsl Exp $ */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: ftpio.c,v 1.62 2003/12/20 03:31:56 grant Exp $");
+__RCSID("$NetBSD: ftpio.c,v 1.63 2004/10/30 15:04:45 dsl Exp $");
#endif
/*-
@@ -238,7 +238,7 @@
fflush(stdout);
#endif /* EXPECT_DEBUG */
- if (ftprc && isdigit(buf[match.rm_so+1]))
+ if (ftprc && isdigit((unsigned char)buf[match.rm_so+1]))
*ftprc = atoi(buf+match.rm_so+1);
done=1;
@@ -894,14 +894,14 @@
state = ST_NONE;
else if (p == 'a' || p == 'A')
state = ST_LTA;
- else if (!isspace(p))
+ else if (!isspace((unsigned char)p))
state = ST_TAG;
break;
case ST_LTA:
/* in tag -- "<a" already found */
if (p == '>')
state = ST_NONE;
- else if (isspace(p))
+ else if (isspace((unsigned char)p))
state = ST_TAGA;
else
state = ST_TAG;
@@ -917,14 +917,14 @@
state = ST_NONE;
else if (p == 'h' || p == 'H')
state = ST_H;
- else if (!isspace(p))
+ else if (!isspace((unsigned char)p))
state = ST_TAGAX;
break;
case ST_TAGAX:
/* in unknown keyword in a-tag */
if (p == '>')
state = ST_NONE;
- else if (isspace(p))
+ else if (isspace((unsigned char)p))
state = ST_TAGA;
break;
case ST_H:
@@ -933,7 +933,7 @@
state = ST_NONE;
else if (p == 'r' || p == 'R')
state = ST_R;
- else if (isspace(p))
+ else if (isspace((unsigned char)p))
state = ST_TAGA;
else
state = ST_TAGAX;
@@ -944,7 +944,7 @@
state = ST_NONE;
else if (p == 'e' || p == 'E')
state = ST_E;
- else if (isspace(p))
+ else if (isspace((unsigned char)p))
state = ST_TAGA;
else
state = ST_TAGAX;
@@ -955,7 +955,7 @@
state = ST_NONE;
else if (p == 'f' || p == 'F')
state = ST_F;
- else if (isspace(p))
+ else if (isspace((unsigned char)p))
state = ST_TAGA;
else
state = ST_TAGAX;
@@ -966,7 +966,7 @@
state = ST_NONE;
else if (p == '=')
state = ST_HREF;
- else if (!isspace(p))
+ else if (!isspace((unsigned char)p))
state = ST_TAGAX;
break;
case ST_HREF:
@@ -975,7 +975,7 @@
if (p == '>')
state = ST_NONE;
/* skip spaces before URL */
- else if (!isspace(p))
+ else if (!isspace((unsigned char)p))
state = ST_TAGA;
break;
/* no default case by purpose */
diff -r 97559058b478 -r 974d1a44ef3b usr.sbin/pkg_install/lib/str.c
--- a/usr.sbin/pkg_install/lib/str.c Sat Oct 30 15:01:32 2004 +0000
+++ b/usr.sbin/pkg_install/lib/str.c Sat Oct 30 15:04:45 2004 +0000
@@ -1,11 +1,11 @@
-/* $NetBSD: str.c,v 1.46 2003/10/04 00:50:34 wiz Exp $ */
+/* $NetBSD: str.c,v 1.47 2004/10/30 15:04:45 dsl Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#if 0
static const char *rcsid = "Id: str.c,v 1.5 1997/10/08 07:48:21 charnier Exp";
#else
-__RCSID("$NetBSD: str.c,v 1.46 2003/10/04 00:50:34 wiz Exp $");
+__RCSID("$NetBSD: str.c,v 1.47 2004/10/30 15:04:45 dsl Exp $");
#endif
#endif
@@ -97,7 +97,7 @@
str_lowercase(char *s)
{
for (; *s; s++) {
- *s = tolower(*s);
+ *s = tolower((unsigned char)*s);
}
}
@@ -198,8 +198,8 @@
return 0;
}
ALLOC(int64_t, ap->v, ap->size, ap->c, 62, "mkver", exit(EXIT_FAILURE));
- if (isdigit(*num)) {
- for (cp = num, n = 0 ; isdigit(*num) ; num++) {
+ if (isdigit((unsigned char)*num)) {
+ for (cp = num, n = 0 ; isdigit((unsigned char)*num) ; num++) {
n = (n * 10) + (*num - '0');
}
ap->v[ap->c++] = n;
@@ -212,15 +212,15 @@
}
}
if (strncasecmp(num, "nb", 2) == 0) {
- for (cp = num, num += 2, n = 0 ; isdigit(*num) ; num++) {
+ for (cp = num, num += 2, n = 0 ; isdigit((unsigned char)*num) ; num++) {
n = (n * 10) + (*num - '0');
}
ap->netbsd = n;
return (int)(num - cp);
}
- if (isalpha(*num)) {
+ if (isalpha((unsigned char)*num)) {
ap->v[ap->c++] = Dot;
- cp = strchr(alphas, tolower(*num));
+ cp = strchr(alphas, tolower((unsigned char)*num));
ALLOC(int64_t, ap->v, ap->size, ap->c, 62, "mkver", exit(EXIT_FAILURE));
ap->v[ap->c++] = (int64_t)(cp - alphas) + 1;
return 1;
diff -r 97559058b478 -r 974d1a44ef3b usr.sbin/pppd/pppd/chap_ms.c
--- a/usr.sbin/pppd/pppd/chap_ms.c Sat Oct 30 15:01:32 2004 +0000
+++ b/usr.sbin/pppd/pppd/chap_ms.c Sat Oct 30 15:04:45 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: chap_ms.c,v 1.12 2002/09/13 14:32:12 itojun Exp $ */
+/* $NetBSD: chap_ms.c,v 1.13 2004/10/30 15:07:15 dsl Exp $ */
/*
* chap_ms.c - Microsoft MS-CHAP compatible implementation.
@@ -46,7 +46,7 @@
#if 0
#define RCSID "Id: chap_ms.c,v 1.15 1999/08/13 06:46:12 paulus Exp "
#else
-__RCSID("$NetBSD: chap_ms.c,v 1.12 2002/09/13 14:32:12 itojun Exp $");
+__RCSID("$NetBSD: chap_ms.c,v 1.13 2004/10/30 15:07:15 dsl Exp $");
#endif
#endif
@@ -316,7 +316,7 @@
/* LANMan password is case insensitive */
BZERO(UcasePassword, sizeof(UcasePassword));
for (i = 0; i < secret_len; i++)
- UcasePassword[i] = (u_char)toupper(secret[i]);
+ UcasePassword[i] = (u_char)toupper((unsigned char)secret[i]);
DesEncrypt( StdText, UcasePassword + 0, PasswordHash + 0 );
DesEncrypt( StdText, UcasePassword + 7, PasswordHash + 8 );
ChallengeResponse(rchallenge, PasswordHash, response->LANManResp);
diff -r 97559058b478 -r 974d1a44ef3b usr.sbin/pvctxctl/pvctxctl.c
--- a/usr.sbin/pvctxctl/pvctxctl.c Sat Oct 30 15:01:32 2004 +0000
+++ b/usr.sbin/pvctxctl/pvctxctl.c Sat Oct 30 15:04:45 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pvctxctl.c,v 1.3 2001/05/07 14:00:23 kleink Exp $ */
+/* $NetBSD: pvctxctl.c,v 1.4 2004/10/30 15:08:49 dsl Exp $ */
/*
* Copyright (C) 1998
@@ -76,7 +76,7 @@
usage();
if_name = argv[1];
- if (argc > 2 && isdigit(argv[2][0]))
+ if (argc > 2 && isdigit((unsigned char)argv[2][0]))
str2vc(argv[2], &vpi, &vci);
optind = 3;
Home |
Main Index |
Thread Index |
Old Index