Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/httpd bozohttpd: fix argument type for functions fro...



details:   https://anonhg.NetBSD.org/src/rev/da8c7099ddee
branches:  trunk
changeset: 954411:da8c7099ddee
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Apr 08 07:02:11 2021 +0000

description:
bozohttpd: fix argument type for functions from <ctype.h>

Found by the recently added check to lint (message 342).

ok mrg@

diffstat:

 libexec/httpd/bozohttpd.c |   4 ++--
 libexec/httpd/cgi-bozo.c  |  13 +++++++------
 2 files changed, 9 insertions(+), 8 deletions(-)

diffs (59 lines):

diff -r 91ac559e2c09 -r da8c7099ddee libexec/httpd/bozohttpd.c
--- a/libexec/httpd/bozohttpd.c Thu Apr 08 06:52:42 2021 +0000
+++ b/libexec/httpd/bozohttpd.c Thu Apr 08 07:02:11 2021 +0000
@@ -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 @@
                 */
                if (sep) {
                        for (s = url; s != sep;) {
-                               if (!isalnum((int)*s) &&
+                               if (!isalnum((unsigned char)*s) &&
                                    *s != '+' && *s != '-' && *s != '.')
                                        break;
                                if (++s == sep) {
diff -r 91ac559e2c09 -r da8c7099ddee libexec/httpd/cgi-bozo.c
--- a/libexec/httpd/cgi-bozo.c  Thu Apr 08 06:52:42 2021 +0000
+++ b/libexec/httpd/cgi-bozo.c  Thu Apr 08 07:02:11 2021 +0000
@@ -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 @@
                        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 @@
                        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 @@
                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



Home | Main Index | Thread Index | Old Index