]> granicus.if.org Git - apache/commitdiff
Optimization: replace apr_pstrndup() with apr_pstrmemdup() in
authorBrian Pane <brianp@apache.org>
Sun, 2 Dec 2001 20:38:33 +0000 (20:38 +0000)
committerBrian Pane <brianp@apache.org>
Sun, 2 Dec 2001 20:38:33 +0000 (20:38 +0000)
ap_escape_html() to eliminate a redundant scan through the string.

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

server/util.c

index 9de5a8391622e669d9d46d467e1ad2dd5a1e3f1a..71b42f8b66f15a58cc198a2ce4ba48d8719cd88c 100644 (file)
@@ -1649,7 +1649,7 @@ AP_DECLARE(char *) ap_escape_html(apr_pool_t *p, const char *s)
            j += 4;
 
     if (j == 0)
-       return apr_pstrndup(p, s, i);
+       return apr_pstrmemdup(p, s, i);
 
     x = apr_palloc(p, i + j + 1);
     for (i = 0, j = 0; s[i] != '\0'; i++, j++)