apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r475750 - /apr/apr/trunk/include/apr_strings.h
Date Thu, 16 Nov 2006 14:33:49 GMT
Author: trawick
Date: Thu Nov 16 06:33:48 2006
New Revision: 475750

URL: http://svn.apache.org/viewvc?view=rev&rev=475750
Log:
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/trunk/include/apr_strings.h

Modified: apr/apr/trunk/include/apr_strings.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_strings.h?view=diff&rev=475750&r1=475749&r2=475750
==============================================================================
--- apr/apr/trunk/include/apr_strings.h (original)
+++ apr/apr/trunk/include/apr_strings.h Thu Nov 16 06:33:48 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);
 



Mime
View raw message