]> granicus.if.org Git - apache/commitdiff
s/apr_pstrndup/apr_pstrmemdup/ when applicable
authorChristophe Jaillet <jailletc36@apache.org>
Sat, 1 Feb 2014 08:26:33 +0000 (08:26 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Sat, 1 Feb 2014 08:26:33 +0000 (08:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1563381 13f79535-47bb-0310-9956-ffa450edef68

modules/cache/cache_storage.c
server/util.c

index 782dc712fcfc2639c646c895977a739258170f47..234eb9bb7453141bc8ba121455052779e951b65f 100644 (file)
@@ -582,7 +582,7 @@ static apr_status_t cache_canonicalise_key(request_rec *r, apr_pool_t* p,
                     && !strncmp(param + 1, *identifier, len)
                     && (*(param + len + 1) == '=')
                     && !ap_strchr_c(param + len + 2, '/')) {
-                path = apr_pstrndup(p, path, param - path);
+                path = apr_pstrmemdup(p, path, param - path);
                 continue;
             }
             /*
index 5ceb9a8df3a6cdd045e5d821e1406bb338fcb886..ad465845c1ab63629e1d8842162cde9f81f8265c 100644 (file)
@@ -116,7 +116,7 @@ AP_DECLARE(char *) ap_field_noparam(apr_pool_t *p, const char *intype)
         while ((semi > intype) && apr_isspace(semi[-1])) {
             semi--;
         }
-        return apr_pstrndup(p, intype, semi - intype);
+        return apr_pstrmemdup(p, intype, semi - intype);
     }
 }
 
@@ -737,7 +737,7 @@ AP_DECLARE(char *) ap_getword_nulls(apr_pool_t *atrans, const char **line,
         return res;
     }
 
-    res = apr_pstrndup(atrans, *line, pos - *line);
+    res = apr_pstrmemdup(atrans, *line, pos - *line);
 
     ++pos;
 
@@ -1464,7 +1464,6 @@ AP_DECLARE(char *) ap_get_token(apr_pool_t *p, const char **accept_line,
     const char *ptr = *accept_line;
     const char *tok_start;
     char *token;
-    int tok_len;
 
     /* Find first non-white byte */
 
@@ -1485,8 +1484,7 @@ AP_DECLARE(char *) ap_get_token(apr_pool_t *p, const char **accept_line,
                     break;
     }
 
-    tok_len = ptr - tok_start;
-    token = apr_pstrndup(p, tok_start, tok_len);
+    token = apr_pstrmemdup(p, tok_start, ptr - tok_start);
 
     /* Advance accept_line pointer to the next non-white byte */