Module Name: src
Committed By: rillig
Date: Thu Apr 8 07:02:12 UTC 2021
Modified Files:
src/libexec/httpd: bozohttpd.c cgi-bozo.c
Log Message:
bozohttpd: fix argument type for functions from <ctype.h>
Found by the recently added check to lint (message 342).
ok mrg@
To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.53 -r1.54 src/libexec/httpd/cgi-bozo.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.129 src/libexec/httpd/bozohttpd.c:1.130
--- src/libexec/httpd/bozohttpd.c:1.129 Sun Apr 4 18:14:26 2021
+++ src/libexec/httpd/bozohttpd.c Thu Apr 8 07:02:11 2021
@@ -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,
*/
if (sep) {
for (s = url; s != sep;) {
- if (!isalnum((int)*s) &&
+ if (!isalnum((unsigned char)*s) &&
*s != '+' && *s != '-' && *s != '.')
break;
if (++s == sep) {
Index: src/libexec/httpd/cgi-bozo.c
diff -u src/libexec/httpd/cgi-bozo.c:1.53 src/libexec/httpd/cgi-bozo.c:1.54
--- src/libexec/httpd/cgi-bozo.c:1.53 Sat Feb 27 12:36:46 2021
+++ src/libexec/httpd/cgi-bozo.c Thu Apr 8 07:02:12 2021
@@ -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 *requ
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 *requ
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