aboutsummaryrefslogtreecommitdiff
path: root/iri.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2022-11-17 09:21:38 +0000
committerOmar Polo <op@omarpolo.com>2022-11-17 09:21:38 +0000
commit6130e0eeac9db4fa8e6fe5934ec2d0ab202f979e (patch)
tree1aff25c6cc404219c7f8f5e29f05da7e8caab24d /iri.c
parent71cac3a08bf84e8b9f8d52999df34913ef4efc55 (diff)
always cast is*() arguments to unsigned char
Diffstat (limited to 'iri.c')
-rw-r--r--iri.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/iri.c b/iri.c
index 8725cdd..c1f9781 100644
--- a/iri.c
+++ b/iri.c
@@ -51,7 +51,8 @@ valid_pct_enc_string(char *s)
if (*s != '%')
return 1;
- if (!isxdigit(s[1]) || !isxdigit(s[2]))
+ if (!isxdigit((unsigned char)s[1]) ||
+ !isxdigit((unsigned char)s[2]))
return 0;
if (s[1] == '0' && s[2] == '0')
@@ -153,7 +154,7 @@ parse_port(struct parser *p)
p->parsed->port = p->iri;
- for (; isdigit(*p->iri); p->iri++) {
+ for (; isdigit((unsigned char)*p->iri); p->iri++) {
i = i * 10 + *p->iri - '0';
if (i > UINT16_MAX) {
p->err = "port number too large";