apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r476154 - /apr/apr/branches/0.9.x/include/apr_strings.h
Date Fri, 17 Nov 2006 14:35:47 GMT
Author: trawick
Date: Fri Nov 17 06:35:46 2006
New Revision: 476154

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

Modified: apr/apr/branches/0.9.x/include/apr_strings.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/include/apr_strings.h?view=diff&rev=476154&r1=476153&r2=476154
==============================================================================
--- apr/apr/branches/0.9.x/include/apr_strings.h (original)
+++ apr/apr/branches/0.9.x/include/apr_strings.h Fri Nov 17 06:35:46 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