]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1934594, r1934597 from trunk:
authorJoe Orton <jorton@apache.org>
Tue, 2 Jun 2026 13:55:21 +0000 (13:55 +0000)
committerJoe Orton <jorton@apache.org>
Tue, 2 Jun 2026 13:55:21 +0000 (13:55 +0000)
memchr() takes a char * as a first parameter, and 'buf' is a const char *.

This breaks build process at least with gcc 16.1.1 and maintainer-mode enabled.

Without maintainer-mode, only a warning is generated.

strchr() takes a char * as a first parameter, and in the cases a const char * is passed.

This breaks build process at least with gcc 16.1.1 and maintainer-mode enabled.

Without maintainer-mode, only a warning is generated.

Submitted by: jailletc36
Reviewed by: jailletc36, jim, jorton

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1934885 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/sed1.c
support/ab.c
support/rotatelogs.c

index 047f49ba1317074f91bf0f62c1e8934ee847c3b1..21f6e5ec7e2f347b49dbcd6636ba00b1915c1b08 100644 (file)
@@ -436,7 +436,7 @@ apr_status_t sed_eval_buffer(sed_eval_t *eval, const char *buf, apr_size_t bufsz
         char *n;
         apr_size_t llen;
 
-        n = memchr(buf, '\n', bufsz);
+        n = memchr((char *)buf, '\n', bufsz);
         if (n == NULL)
             break;
 
index bee3812d9f4101be6fc8086d66c7ce38ed2fa2be..9d74aa1976a8c4ad01f75e331ebb648cb7704e16 100644 (file)
@@ -2261,7 +2261,7 @@ static int parse_url(const char *url)
     }
 #endif
 
-    if ((cp = strchr(url, '/')) == NULL)
+    if ((cp = strchr((char *)url, '/')) == NULL)
         return 1;
     h = apr_pstrmemdup(cntxt, url, cp - url);
     rv = apr_parse_addr_port(&hostname, &scope_id, &port, h, cntxt);
@@ -2537,7 +2537,7 @@ int main(int argc, const char * const argv[])
                     /*
                      * assume proxy-name[:port]
                      */
-                    if ((p = strchr(opt_arg, ':'))) {
+                    if ((p = strchr((char *)opt_arg, ':'))) {
                         *p = '\0';
                         p++;
                         proxyport = atoi(p);
index e0819da548ace207726fb546c162df1088f838af..dd78ca82adb1c1fb068d977a1497892e95f021d5 100644 (file)
@@ -542,16 +542,16 @@ static const char *get_time_or_size(rotate_config_t *config,
     char *ptr = NULL;
     /* Byte multiplier */
     unsigned int mult = 1;
-    if ((ptr = strchr(arg, 'B')) != NULL) { /* Found KB size */
+    if ((ptr = strchr((char *)arg, 'B')) != NULL) { /* Found KB size */
         mult = 1;
     }
-    else if ((ptr = strchr(arg, 'K')) != NULL) { /* Found KB size */
+    else if ((ptr = strchr((char *)arg, 'K')) != NULL) { /* Found KB size */
         mult = 1024;
     }
-    else if ((ptr = strchr(arg, 'M')) != NULL) { /* Found MB size */
+    else if ((ptr = strchr((char *)arg, 'M')) != NULL) { /* Found MB size */
         mult = 1024 * 1024;
     }
-    else if ((ptr = strchr(arg, 'G')) != NULL) { /* Found GB size */
+    else if ((ptr = strchr((char *)arg, 'G')) != NULL) { /* Found GB size */
         mult = 1024 * 1024 * 1024;
     }
     if (ptr) { /* rotation based on file size */