diff options
author | Omar Polo <op@omarpolo.com> | 2022-11-17 09:21:38 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2022-11-17 09:21:38 +0000 |
commit | 6130e0eeac9db4fa8e6fe5934ec2d0ab202f979e (patch) | |
tree | 1aff25c6cc404219c7f8f5e29f05da7e8caab24d /iri.c | |
parent | 71cac3a08bf84e8b9f8d52999df34913ef4efc55 (diff) |
always cast is*() arguments to unsigned char
Diffstat (limited to 'iri.c')
-rw-r--r-- | iri.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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"; |