* @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)
}
-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);
}