]> granicus.if.org Git - apache/commitdiff
Make ap_pstr2_alnum accept const char dest
authorStefan Fritsch <sf@apache.org>
Fri, 21 Jan 2011 09:03:52 +0000 (09:03 +0000)
committerStefan Fritsch <sf@apache.org>
Fri, 21 Jan 2011 09:03:52 +0000 (09:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1061695 13f79535-47bb-0310-9956-ffa450edef68

include/httpd.h
server/util.c

index 146f3b9756383910ff5bde6395ca59a437f0276d..224b38afae811805d24323b52a663fcda0447d60 100644 (file)
@@ -1839,7 +1839,8 @@ AP_DECLARE(int) ap_request_has_body(request_rec *r);
  * @param  dest cleaned up, allocated string
  * @return Status value indicating whether the cleaning was successful or not.
  */
-AP_DECLARE(apr_status_t) ap_pstr2_alnum(apr_pool_t *p, const char *src, char **dest);
+AP_DECLARE(apr_status_t) ap_pstr2_alnum(apr_pool_t *p, const char *src,
+                                        const char **dest);
 
 /**
  * Cleanup a string (mainly to be filesystem safe)
index 1911616dac45b4079b17584bce552d4f43ce1434..b61aa8eb8040d16d96d470cc6fc44cce8804bedc 100644 (file)
@@ -2183,10 +2183,12 @@ AP_DECLARE(apr_status_t) ap_str2_alnum(const char *src, char *dest) {
     
 }
 
-AP_DECLARE(apr_status_t) ap_pstr2_alnum(apr_pool_t *p, const char *src, char **dest)
+AP_DECLARE(apr_status_t) ap_pstr2_alnum(apr_pool_t *p, const char *src,
+                                        const char **dest)
 {
-    *dest = apr_palloc(p, strlen(src)+1);
-    if (!*dest)
+    char *new = apr_palloc(p, strlen(src)+1);
+    if (!new)
         return APR_ENOMEM;
-    return ap_str2_alnum(src, *dest);
+    *dest = new;
+    return ap_str2_alnum(src, new);
 }