summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2006-11-17 14:33:38 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2006-11-17 14:33:38 +0000
commitfce438c545051d219150749ae74235300bc234a1 (patch)
treefb1fc89bb7e80ad0a292d585a5d76bba93e6c858
parent44c16a28fbdf193f51b3d2c3389e67b798c95395 (diff)
downloadlibapr-fce438c545051d219150749ae74235300bc234a1.tar.gz
merge rev 475750 from trunk:
Clarify the behavior of apr_pstrndup(), which differs from Apache 1.3's ap_pstrndup() in that it doesn't overallocate memory for the resulting string. Submitted by: trawick, jorton git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.2.x@476152 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/apr_strings.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/apr_strings.h b/include/apr_strings.h
index 9c28f3f11..fcfb7777a 100644
--- a/include/apr_strings.h
+++ b/include/apr_strings.h
@@ -109,12 +109,14 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s);
APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n);
/**
- * duplicate the first n characters of a string into memory allocated
- * out of a pool; the new string will be null-terminated
+ * Duplicate at most n characters of a string into memory allocated
+ * out of a pool; the new string will be NUL-terminated
* @param p The pool to allocate out of
* @param s The string to duplicate
- * @param n The number of characters to duplicate
+ * @param n The maximum number of characters to duplicate
* @return The new string
+ * @remark The amount of memory allocated from the pool is the length
+ * of the returned string including the NUL terminator
*/
APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n);