]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Save a few cycles.
authorChristophe Jaillet <jailletc36@apache.org>
Fri, 4 May 2018 19:54:53 +0000 (19:54 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Fri, 4 May 2018 19:54:53 +0000 (19:54 +0000)
Use apr_pstrmemdup instead of apr_pstrndup when possible.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1830944 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_proxy_html.c

index 8e6989e2a427e6ab2a0bf08013c84814a7db51d2..ec0259ce0c62e77b3f2935c38fceafcf3e3e484d 100644 (file)
@@ -716,7 +716,7 @@ static meta *metafix(request_rec *r, const char *buf, apr_size_t len)
                     } else {
                         for (q = p; *q && !apr_isspace(*q) && (*q != '>'); ++q);
                     }
-                    content = apr_pstrndup(r->pool, p, q-p);
+                    content = apr_pstrmemdup(r->pool, p, q-p);
                     break;
                 }
             }
@@ -768,7 +768,7 @@ static const char *interpolate_vars(request_rec *r, const char *str)
         replacement = apr_table_get(r->subprocess_env, var);
         if (!replacement) {
             if (delim)
-                replacement = apr_pstrndup(r->pool, delim+1, end-delim-1);
+                replacement = apr_pstrmemdup(r->pool, delim+1, end-delim-1);
             else
                 replacement = "";
         }