diff options
| author | rillig <rillig@NetBSD.org> | 2021-04-08 07:02:11 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2021-04-08 07:02:11 +0000 |
| commit | daa4ced05e426f7ddef53902a8b31cbc4a3d374f (patch) | |
| tree | b7e56953cc9f831846e37d9d20289a4c6f5ca6b6 /libexec/httpd | |
| parent | 798520af466f06c7e728e37371a2b748c8f1684c (diff) | |
bozohttpd: fix argument type for functions from <ctype.h>
Found by the recently added check to lint (message 342).
ok mrg@
Diffstat (limited to 'libexec/httpd')
| -rw-r--r-- | libexec/httpd/bozohttpd.c | 4 | ||||
| -rw-r--r-- | libexec/httpd/cgi-bozo.c | 13 |
2 files changed, 9 insertions, 8 deletions
diff --git a/libexec/httpd/bozohttpd.c b/libexec/httpd/bozohttpd.c index 54b97509d2b..67083b2c678 100644 --- a/libexec/httpd/bozohttpd.c +++ b/libexec/httpd/bozohttpd.c @@ -1,4 +1,4 @@ -/* $NetBSD: bozohttpd.c,v 1.129 2021/04/04 18:14:26 mrg Exp $ */ +/* $NetBSD: bozohttpd.c,v 1.130 2021/04/08 07:02:11 rillig Exp $ */ /* $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $ */ @@ -1110,7 +1110,7 @@ handle_redirect(bozo_httpreq_t *request, const char *url, int absolute) */ if (sep) { for (s = url; s != sep;) { - if (!isalnum((int)*s) && + if (!isalnum((unsigned char)*s) && *s != '+' && *s != '-' && *s != '.') break; if (++s == sep) { diff --git a/libexec/httpd/cgi-bozo.c b/libexec/httpd/cgi-bozo.c index 07f90579b88..491da699021 100644 --- a/libexec/httpd/cgi-bozo.c +++ b/libexec/httpd/cgi-bozo.c @@ -1,4 +1,4 @@ -/* $NetBSD: cgi-bozo.c,v 1.53 2021/02/27 12:36:46 mrg Exp $ */ +/* $NetBSD: cgi-bozo.c,v 1.54 2021/04/08 07:02:12 rillig Exp $ */ /* $eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $ */ @@ -289,7 +289,8 @@ parse_search_string(bozo_httpreq_t *request, const char *query, size_t *args_len goto parse_err; while (*s) { /* check if it's unreserved */ - if (isalpha((int)*s) || isdigit((int)*s) || + if (isalpha((unsigned char)*s) || + isdigit((unsigned char)*s) || strchr(UNRESERVED_CHAR, *s)) { s++; continue; @@ -299,8 +300,8 @@ parse_search_string(bozo_httpreq_t *request, const char *query, size_t *args_len if (*s == '%') { if (s[1] == '\0' || s[2] == '\0') goto parse_err; - if (!isxdigit((int)s[1]) || - !isxdigit((int)s[2])) + if (!isxdigit((unsigned char)s[1]) || + !isxdigit((unsigned char)s[2])) goto parse_err; s += 3; continue; @@ -517,8 +518,8 @@ bozo_process_cgi(bozo_httpreq_t *request) strcpy(t, "HTTP_"); t += strlen(t); for (s2 = headp->h_header; *s2; t++, s2++) - if (islower((unsigned)*s2)) - *t = toupper((unsigned)*s2); + if (islower((unsigned char)*s2)) + *t = toupper((unsigned char)*s2); else if (*s2 == '-') *t = '_'; else |
