Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/dist/pf/sbin/pfctl Add (unsigned char) cast to ctype functions
details: https://anonhg.NetBSD.org/src/rev/48653859c364
branches: trunk
changeset: 570811:48653859c364
user: dsl <dsl%NetBSD.org@localhost>
date: Fri Oct 29 19:46:27 2004 +0000
description:
Add (unsigned char) cast to ctype functions
diffstat:
dist/pf/sbin/pfctl/parse.y | 4 ++--
dist/pf/sbin/pfctl/pfctl_osfp.c | 30 +++++++++++++++---------------
dist/pf/sbin/pfctl/pfctl_parser.c | 6 +++---
dist/pf/sbin/pfctl/pfctl_radix.c | 6 +++---
dist/pf/sbin/pfctl/pfctl_table.c | 4 ++--
5 files changed, 25 insertions(+), 25 deletions(-)
diffs (194 lines):
diff -r cbdce2122100 -r 48653859c364 dist/pf/sbin/pfctl/parse.y
--- a/dist/pf/sbin/pfctl/parse.y Fri Oct 29 19:32:22 2004 +0000
+++ b/dist/pf/sbin/pfctl/parse.y Fri Oct 29 19:46:27 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.y,v 1.3 2004/06/23 04:38:43 itojun Exp $ */
+/* $NetBSD: parse.y,v 1.4 2004/10/29 19:46:27 dsl Exp $ */
/* $OpenBSD: parse.y,v 1.449 2004/03/20 23:20:20 david Exp $ */
/*
@@ -386,7 +386,7 @@
#define DYNIF_MULTIADDR(addr) ((addr).type == PF_ADDR_DYNIFTL && \
(!((addr).iflags & PFI_AFLAG_NOALIAS) || \
- !isdigit((addr).v.ifname[strlen((addr).v.ifname)-1])))
+ !isdigit((unsigned char)(addr).v.ifname[strlen((addr).v.ifname)-1])))
%}
diff -r cbdce2122100 -r 48653859c364 dist/pf/sbin/pfctl/pfctl_osfp.c
--- a/dist/pf/sbin/pfctl/pfctl_osfp.c Fri Oct 29 19:32:22 2004 +0000
+++ b/dist/pf/sbin/pfctl/pfctl_osfp.c Fri Oct 29 19:46:27 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pfctl_osfp.c,v 1.2 2004/06/22 15:16:30 itojun Exp $ */
+/* $NetBSD: pfctl_osfp.c,v 1.3 2004/10/29 19:46:27 dsl Exp $ */
/* $OpenBSD: pfctl_osfp.c,v 1.8 2004/02/27 10:42:00 henning Exp $ */
/*
@@ -133,9 +133,9 @@
break;
}
/* Chop off whitespace */
- while (len > 0 && isspace(line[len - 1]))
+ while (len > 0 && isspace((unsigned char)line[len - 1]))
len--;
- while (len > 0 && isspace(line[0])) {
+ while (len > 0 && isspace((unsigned char)line[0])) {
len--;
line++;
}
@@ -516,7 +516,7 @@
if (index(version_name, ' '))
strlcat(buf, " ", len);
else if (index(version_name, '.') &&
- isdigit(*subtype_name))
+ isdigit((unsigned char)*subtype_name))
strlcat(buf, ".", len);
else
strlcat(buf, " ", len);
@@ -550,30 +550,30 @@
#define EXPAND(field) do { \
int _dot = -1, _start = -1, _end = -1, _i = 0; \
/* pick major version out of #.# */ \
- if (isdigit(fp->field[_i]) && fp->field[_i+1] == '.') { \
+ if (isdigit((unsigned char)fp->field[_i]) && fp->field[_i+1] == '.') { \
_dot = fp->field[_i] - '0'; \
_i += 2; \
} \
- if (isdigit(fp->field[_i])) \
+ if (isdigit((unsigned char)fp->field[_i])) \
_start = fp->field[_i++] - '0'; \
else \
break; \
- if (isdigit(fp->field[_i])) \
+ if (isdigit((unsigned char)fp->field[_i])) \
_start = (_start * 10) + fp->field[_i++] - '0'; \
if (fp->field[_i++] != '-') \
break; \
- if (isdigit(fp->field[_i]) && fp->field[_i+1] == '.' && \
+ if (isdigit((unsigned char)fp->field[_i]) && fp->field[_i+1] == '.' && \
fp->field[_i] - '0' == _dot) \
_i += 2; \
else if (_dot != -1) \
break; \
- if (isdigit(fp->field[_i])) \
+ if (isdigit((unsigned char)fp->field[_i])) \
_end = fp->field[_i++] - '0'; \
else \
break; \
- if (isdigit(fp->field[_i])) \
+ if (isdigit((unsigned char)fp->field[_i])) \
_end = (_end * 10) + fp->field[_i++] - '0'; \
- if (isdigit(fp->field[_i])) \
+ if (isdigit((unsigned char)fp->field[_i])) \
_end = (_end * 10) + fp->field[_i++] - '0'; \
if (fp->field[_i] != '\0') \
break; \
@@ -904,7 +904,7 @@
return (0);
for (i = 0; tcpopts[i] && *optcnt < PF_OSFP_MAX_OPTS;) {
- switch ((opt = toupper(tcpopts[i++]))) {
+ switch ((opt = toupper((unsigned char)tcpopts[i++]))) {
case 'N': /* FALLTHROUGH */
case 'S':
*packed = (*packed << PF_OSFP_TCPOPT_BITS) |
@@ -940,7 +940,7 @@
i++;
}
do {
- if (!isdigit(tcpopts[i])) {
+ if (!isdigit((unsigned char)tcpopts[i])) {
fprintf(stderr, "%s:%d unknown "
"character '%c' in %c TCP opt\n",
filename, lineno, tcpopts[i], opt);
@@ -981,7 +981,7 @@
size_t plen = *len;
- while (plen && isspace(*ptr)) {
+ while (plen && isspace((unsigned char)*ptr)) {
plen--;
ptr++;
}
@@ -996,7 +996,7 @@
} else {
*len = 0;
}
- while (*fieldlen && isspace(ret[*fieldlen - 1]))
+ while (*fieldlen && isspace((unsigned char)ret[*fieldlen - 1]))
(*fieldlen)--;
return (ret);
}
diff -r cbdce2122100 -r 48653859c364 dist/pf/sbin/pfctl/pfctl_parser.c
--- a/dist/pf/sbin/pfctl/pfctl_parser.c Fri Oct 29 19:32:22 2004 +0000
+++ b/dist/pf/sbin/pfctl/pfctl_parser.c Fri Oct 29 19:46:27 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pfctl_parser.c,v 1.3 2004/06/24 11:05:10 hannken Exp $ */
+/* $NetBSD: pfctl_parser.c,v 1.4 2004/10/29 19:46:27 dsl Exp $ */
/* $OpenBSD: pfctl_parser.c,v 1.194.2.1 2004/05/05 04:00:50 brad Exp $ */
/*
@@ -1169,7 +1169,7 @@
char *p, buf[IFNAMSIZ];
int group;
- group = !isdigit(ifa_name[strlen(ifa_name) - 1]);
+ group = !isdigit((unsigned char)ifa_name[strlen(ifa_name) - 1]);
if (group && !group_ok)
return (NULL);
if (iftab == NULL)
@@ -1182,7 +1182,7 @@
if (!group) {
/* look for clonable and/or dynamic interface */
strlcpy(buf, ifa_name, sizeof(buf));
- for (p = buf + strlen(buf) - 1; p > buf && isdigit(*p); p--)
+ for (p = buf + strlen(buf) - 1; p > buf && isdigit((unsigned char)*p); p--)
*p = '\0';
for (n = iftab; n != NULL; n = n->next)
if (n->af == AF_LINK &&
diff -r cbdce2122100 -r 48653859c364 dist/pf/sbin/pfctl/pfctl_radix.c
--- a/dist/pf/sbin/pfctl/pfctl_radix.c Fri Oct 29 19:32:22 2004 +0000
+++ b/dist/pf/sbin/pfctl/pfctl_radix.c Fri Oct 29 19:46:27 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pfctl_radix.c,v 1.2 2004/06/22 15:16:30 itojun Exp $ */
+/* $NetBSD: pfctl_radix.c,v 1.3 2004/10/29 19:46:27 dsl Exp $ */
/* $OpenBSD: pfctl_radix.c,v 1.24 2004/02/10 18:29:30 henning Exp $ */
/*
@@ -632,7 +632,7 @@
for (;;) {
/* skip spaces */
- while (isspace(next_ch) && !feof(fp))
+ while (isspace((unsigned char)next_ch) && !feof(fp))
next_ch = fgetc(fp);
/* remove from '#' until end of line */
if (next_ch == '#')
@@ -652,7 +652,7 @@
if (i < BUF_SIZE)
buf[i++] = next_ch;
next_ch = fgetc(fp);
- } while (!feof(fp) && !isspace(next_ch));
+ } while (!feof(fp) && !isspace((unsigned char)next_ch));
if (i >= BUF_SIZE) {
errno = EINVAL;
return (-1);
diff -r cbdce2122100 -r 48653859c364 dist/pf/sbin/pfctl/pfctl_table.c
--- a/dist/pf/sbin/pfctl/pfctl_table.c Fri Oct 29 19:32:22 2004 +0000
+++ b/dist/pf/sbin/pfctl/pfctl_table.c Fri Oct 29 19:46:27 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pfctl_table.c,v 1.2 2004/06/22 15:16:30 itojun Exp $ */
+/* $NetBSD: pfctl_table.c,v 1.3 2004/10/29 19:46:27 dsl Exp $ */
/* $OpenBSD: pfctl_table.c,v 1.59 2004/03/15 15:25:44 dhartmei Exp $ */
/*
@@ -549,7 +549,7 @@
struct pfi_if *p;
int i = 0, f = PFI_FLAG_GROUP|PFI_FLAG_INSTANCE;
- if (filter != NULL && *filter && !isdigit(filter[strlen(filter)-1]))
+ if (filter != NULL && *filter && !isdigit((unsigned char)filter[strlen(filter)-1]))
f &= ~PFI_FLAG_INSTANCE;
bzero(&b, sizeof(b));
b.pfrb_type = PFRB_IFACES;
Home |
Main Index |
Thread Index |
Old Index