Hi Bert,
Now this API is inconsistent with svn_stringbuf_ensure.
IMHO, the callers of svn_stringbuf_create_ensure need to always pass at least 1 for the minimum_size.
Regards,
Chris
> Author: rhuijben
> Date: Thu Feb 19 03:41:36 2009
> New Revision: 35974
>
> Log:
> Following up on r35968, fix the exact svn_stringbuf_create block size
> behavior tested by lt-string-test 10: block initialization and growth.
>
> * subversion/include/svn_string.h
> (svn_stringbuf_create_ensure): Update comment to document the +1 behavior.
> * subversion/libsvn_subr/svn_string.c
> (svn_stringbuf_ncreate): Stop incrementing the buffer size as
> svn_stringbuf_create_ensure does this for us.
>
> Modified:
> trunk/subversion/include/svn_string.h
> trunk/subversion/libsvn_subr/svn_string.c
>
> Modified: trunk/subversion/include/svn_string.h
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_string.h?pathrev=35974&r1=35973&r2=35974
> ==============================================================================
> --- trunk/subversion/include/svn_string.h Thu Feb 19 02:17:08 2009 (r35973)
> +++ trunk/subversion/include/svn_string.h Thu Feb 19 03:41:36 2009 (r35974)
> @@ -192,7 +192,8 @@ svn_stringbuf_ncreate(const char *bytes,
> /** Create a new empty bytestring with at least @a minimum_size bytes of
> * space available in the memory block.
> *
> - * (@a minimum_size should include space for the terminating NULL character.)
> + * The allocated string buffer will be one byte larger then @a size to account
> + * for a final '\0'.
> *
> * @since New in 1.6.
> */
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1191678
Received on 2009-02-19 13:40:45 CET