Ah! Thanks!
On Mon, Apr 09, 2001 at 03:44:01PM -0000, cmpilato@tigris.org wrote:
> User: cmpilato
> Date: 01/04/09 08:44:01
>
> Modified: subversion/libsvn_subr svn_string.c
> Log:
> * libsvn_subr/svn_string.c
>
> (svn_string_set): Bug fix: svn_string_ensure makes sure that a
> string is big enough to hold N bytes of data, but doesn't actually
> update the LEN field of the string, so we must update that ourselves
> when copying new contents into a previously existing string.
>
> Revision Changes Path
> 1.11 +4 -3 subversion/subversion/libsvn_subr/svn_string.c
>
> Index: svn_string.c
> ===================================================================
> RCS file: /cvs/subversion/subversion/libsvn_subr/svn_string.c,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -r1.10 -r1.11
> --- svn_string.c 2001/04/03 18:25:18 1.10
> +++ svn_string.c 2001/04/09 15:44:01 1.11
> @@ -114,10 +114,11 @@
> void
> svn_string_set (svn_string_t *str, const char *value)
> {
> - apr_size_t amt = strlen (value) + 1;
> + apr_size_t amt = strlen (value);
>
> - svn_string_ensure (str, amt);
> - memcpy (str->data, value, amt);
> + svn_string_ensure (str, amt + 1);
> + memcpy (str->data, value, amt + 1);
> + str->len = amt;
> }
>
> void
>
>
>
--
Greg Stein, http://www.lyra.org/
Received on Sat Oct 21 14:36:28 2006