-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Julian Foad wrote:
> Author: julianfoad
> Date: Thu Dec 18 14:34:04 2008
> New Revision: 34827
>
> Log:
> * subversion/libsvn_ra_neon/mergeinfo.c
> (cdata_handler): Change bug-hiding "if"s into bug-revealing assertions.
>
> Modified:
> trunk/subversion/libsvn_ra_neon/mergeinfo.c
>
> Modified: trunk/subversion/libsvn_ra_neon/mergeinfo.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_ra_neon/mergeinfo.c?pathrev=34827&r1=34826&r2=34827
> ==============================================================================
> --- trunk/subversion/libsvn_ra_neon/mergeinfo.c Thu Dec 18 14:20:46 2008 (r34826)
> +++ trunk/subversion/libsvn_ra_neon/mergeinfo.c Thu Dec 18 14:34:04 2008 (r34827)
> @@ -133,13 +133,13 @@ cdata_handler(void *baton, int state, co
> switch (state)
> {
> case ELEM_mergeinfo_path:
> - if (mb->curr_path)
> - svn_stringbuf_appendbytes(mb->curr_path, cdata, nlen);
> + SVN_ERR_ASSERT(mb->curr_path);
> + svn_stringbuf_appendbytes(mb->curr_path, cdata, nlen);
I think both 'bug hiding if' and 'SVN_ERR_ASSERT' are extraneous as
mb->curr_path will *never* be NULL as per our code i.e
svn_ra_neon__get_mergeinfo allocates mb->curr_path to empty buffer so no
chance of these to be NULL.
> break;
>
> case ELEM_mergeinfo_info:
> - if (mb->curr_info)
> - svn_stringbuf_appendbytes(mb->curr_info, cdata, nlen);
> + SVN_ERR_ASSERT(mb->curr_info);
> + svn_stringbuf_appendbytes(mb->curr_info, cdata, nlen);
Same applies here.
With regards
Kamesh Jayachandran
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFJS3UL3WHvyO0YTCwRApioAJ9NaQacq464OyxsnScFMK9GTA9tJwCePmZY
r8tS2mWE5NnPbukVs+O9ruU=
=Dyr2
-----END PGP SIGNATURE-----
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=987326
Received on 2008-12-19 11:17:56 CET