summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--strings/apr_strings.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/strings/apr_strings.c b/strings/apr_strings.c
index 7dbbff14d..7bdc1ef99 100644
--- a/strings/apr_strings.c
+++ b/strings/apr_strings.c
@@ -130,7 +130,6 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...)
res = (char *) apr_palloc(a, len + 1);
cp = res;
- *(cp + len) = '\0';
/* Pass two --- copy the argument strings into the result space */
@@ -146,6 +145,8 @@ APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *a, ...)
/* Return the result string */
+ *cp = '\0';
+
return res;
}