You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2006/11/17 15:33:39 UTC

svn commit: r476152 - /apr/apr/branches/1.2.x/include/apr_strings.h

Author: trawick
Date: Fri Nov 17 06:33:38 2006
New Revision: 476152

URL: http://svn.apache.org/viewvc?view=rev&rev=476152
Log:
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

Modified:
    apr/apr/branches/1.2.x/include/apr_strings.h

Modified: apr/apr/branches/1.2.x/include/apr_strings.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/include/apr_strings.h?view=diff&rev=476152&r1=476151&r2=476152
==============================================================================
--- apr/apr/branches/1.2.x/include/apr_strings.h (original)
+++ apr/apr/branches/1.2.x/include/apr_strings.h Fri Nov 17 06:33:38 2006
@@ -109,12 +109,14 @@
 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);