summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-11-22 15:15:16 +0000
committerderaadt <deraadt@openbsd.org>2013-11-22 15:15:16 +0000
commitdefc2139fc8929ac894ea7cc13adb551e3e584a8 (patch)
tree85ca87b58bedcfdb98355681c673036d74d51c93
parentRemove unused proc argument in in6_control(). (diff)
downloadwireguard-openbsd-defc2139fc8929ac894ea7cc13adb551e3e584a8.tar.xz
wireguard-openbsd-defc2139fc8929ac894ea7cc13adb551e3e584a8.zip
unsigned char casts where needed for for ctype.h
checked by florian
-rw-r--r--usr.sbin/bgpctl/irr_asset.c9
-rw-r--r--usr.sbin/bgpctl/irr_output.c4
-rw-r--r--usr.sbin/bgpctl/irr_parser.c4
-rw-r--r--usr.sbin/rtadvd/advcap.c12
4 files changed, 15 insertions, 14 deletions
diff --git a/usr.sbin/bgpctl/irr_asset.c b/usr.sbin/bgpctl/irr_asset.c
index acbc9b776db..7aabfaf71a7 100644
--- a/usr.sbin/bgpctl/irr_asset.c
+++ b/usr.sbin/bgpctl/irr_asset.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: irr_asset.c,v 1.8 2009/04/14 21:10:54 jj Exp $ */
+/* $OpenBSD: irr_asset.c,v 1.9 2013/11/22 15:15:16 deraadt Exp $ */
/*
* Copyright (c) 2007 Henning Brauer <henning@openbsd.org>
@@ -59,7 +59,7 @@ asset_expand(char *s)
if ((name = calloc(1, strlen(s) + 1)) == NULL)
err(1, "asset_expand calloc");
for (i = 0; i < strlen(s); i++)
- name[i] = toupper(s[i]);
+ name[i] = toupper((unsigned char)s[i]);
ass = asset_get(name);
asset_resolve(ass);
@@ -145,7 +145,8 @@ asset_membertype(char *name)
}
/* neither plain nor hierachical set definition, might be aut-num */
- if (!strncmp(name, "AS", 2) && strlen(name) > 2 && isdigit(name[2]))
+ if (!strncmp(name, "AS", 2) && strlen(name) > 2 &&
+ isdigit((unsigned char)name[2]))
return (T_AUTNUM);
return (T_UNKNOWN);
@@ -226,7 +227,7 @@ asset_addmember(char *s)
if ((as = calloc(1, strlen(s) + 1)) == NULL)
err(1, "asset_addmember strdup");
for (i = 0; i < strlen(s); i++)
- as[i] = toupper(s[i]);
+ as[i] = toupper((unsigned char)s[i]);
if ((p = realloc(curass->members,
(curass->n_members + 1) * sizeof(char *))) == NULL)
diff --git a/usr.sbin/bgpctl/irr_output.c b/usr.sbin/bgpctl/irr_output.c
index 5e06a079db4..1f86bdb8ca6 100644
--- a/usr.sbin/bgpctl/irr_output.c
+++ b/usr.sbin/bgpctl/irr_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: irr_output.c,v 1.14 2013/10/27 18:49:25 guenther Exp $ */
+/* $OpenBSD: irr_output.c,v 1.15 2013/11/22 15:15:16 deraadt Exp $ */
/*
* Copyright (c) 2007 Henning Brauer <henning@openbsd.org>
@@ -40,7 +40,7 @@ char *action_torule(char *);
void print_rule(FILE *, struct policy_item *, char *, struct irr_prefix *);
#define allowed_in_address(x) \
- (isalnum(x) || x == '.' || x == ':' || x == '-')
+ (isalnum((unsigned char)x) || x == '.' || x == ':' || x == '-')
int
write_filters(char *outpath)
diff --git a/usr.sbin/bgpctl/irr_parser.c b/usr.sbin/bgpctl/irr_parser.c
index 98bbdcefd7f..c61e0aa3520 100644
--- a/usr.sbin/bgpctl/irr_parser.c
+++ b/usr.sbin/bgpctl/irr_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: irr_parser.c,v 1.10 2012/06/30 08:14:07 sthen Exp $ */
+/* $OpenBSD: irr_parser.c,v 1.11 2013/11/22 15:15:16 deraadt Exp $ */
/*
* Copyright (c) 2007 Henning Brauer <henning@openbsd.org>
@@ -279,7 +279,7 @@ parse_policy(char *key, char *val)
goto ppoerr;
if (strlen(tok) < 3 ||
strncasecmp(tok, "AS", 2) ||
- !isdigit(tok[2]))
+ !isdigit((unsigned char)tok[2]))
errx(1, "peering spec \"%s\": format "
"error, AS expected", tok);
pi->peer_as = strtonum(tok + 2, 1, UINT_MAX,
diff --git a/usr.sbin/rtadvd/advcap.c b/usr.sbin/rtadvd/advcap.c
index 463f8352206..47368e5cc88 100644
--- a/usr.sbin/rtadvd/advcap.c
+++ b/usr.sbin/rtadvd/advcap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: advcap.c,v 1.13 2008/04/21 20:40:55 rainer Exp $ */
+/* $OpenBSD: advcap.c,v 1.14 2013/11/22 15:15:17 deraadt Exp $ */
/* $KAME: advcap.c,v 1.9 2002/05/29 14:28:35 itojun Exp $ */
/*
@@ -275,8 +275,8 @@ tskip(bp)
break;
case '\\':
bp++;
- if (isdigit(*bp)) {
- while (isdigit(*bp++))
+ if (isdigit((unsigned char)*bp)) {
+ while (isdigit((unsigned char)*bp++))
;
} else
bp++;
@@ -327,7 +327,7 @@ tgetnum(id)
if (*bp == '0')
base = 8;
i = 0;
- while (isdigit(*bp))
+ while (isdigit((unsigned char)*bp))
i *= base, i += *bp++ - '0';
return (i);
}
@@ -429,11 +429,11 @@ nextc:
dp++;
if (*dp)
goto nextc;
- if (isdigit(c)) {
+ if (isdigit((unsigned char)c)) {
c -= '0', i = 2;
do
c <<= 3, c |= *str++ - '0';
- while (--i && isdigit(*str));
+ while (--i && isdigit((unsigned char)*str));
}
break;
}