[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r10143 - in trunk/subversion: libsvn_subr tests/libsvn_subr

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2004-07-05 17:59:06 CEST

On Mon, 2004-07-05 at 11:50, Josh Pieper wrote:
> > The valid indices of path->data range from 0 to path->len - 1. Your new
> > code starts accessing path->data[path->len] right off the bat, which is
> > invalid, and then accesses path->data[0] at the end if path->len is 0,
> > which is also invalid if path->len was 0 to start with.
>
> I though svn_stringbuf_t maintained the invariant that
> path->data[path->len] == '\0'?

Oh, of course you're right.

But the purpose of that invariant is to make str->data work as a C
string. Using it for other purposes is confusing (as I just
demonstrated by becoming confused), so I like Klaus's approach better.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 5 18:01:57 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.