You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by SteveKing <st...@gmx.ch> on 2003/03/23 08:55:28 UTC
uninitialized var
Hi,
I have a small request. In the file libsvn_wc/status.c, function
svn_wc_statuses(), the variable const svn_wc_entry_t *entry
is _not_ initialized to NULL like in the function svn_wc_status.
I think it should be initialized to NULL like this:
const svn_wc_entry_t *entry = NULL;
Also, 13 lines below the line
const svn_wc_entry_t *parent_entry;
also should be initialized to NULL like this:
const svn_wc_entry_t *parent_entry = NULL;
That's because the docs (doxygen) say that for
svn_wc_status_t, the entry could be NULL if not
under version control, but it's _not_ right now.
Stefan
Re: uninitialized var
Posted by SteveKing <st...@gmx.ch>.
> On Sun, Mar 23, 2003 at 09:55:28AM +0100, SteveKing wrote:
> > Hi,
> >
> > I have a small request. In the file libsvn_wc/status.c, function
> > svn_wc_statuses(), the variable const svn_wc_entry_t *entry
> > is _not_ initialized to NULL like in the function svn_wc_status.
> > I think it should be initialized to NULL like this:
> >
> > const svn_wc_entry_t *entry = NULL;
> >
> > Also, 13 lines below the line
> > const svn_wc_entry_t *parent_entry;
> > also should be initialized to NULL like this:
> > const svn_wc_entry_t *parent_entry = NULL;
> >
>
> No code path in this function uses either of these variables
uninitialized.
Sorry, my fault. After your post I rechecked my sources and found
that subversion threw an error which I ignored (therefore the 'entry'
wasn't NULL when calling svn_client_status() ).
Sorry to bother you guys.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: uninitialized var
Posted by mb...@boredom.org.
On Sun, Mar 23, 2003 at 09:55:28AM +0100, SteveKing wrote:
> Hi,
>
> I have a small request. In the file libsvn_wc/status.c, function
> svn_wc_statuses(), the variable const svn_wc_entry_t *entry
> is _not_ initialized to NULL like in the function svn_wc_status.
> I think it should be initialized to NULL like this:
>
> const svn_wc_entry_t *entry = NULL;
>
> Also, 13 lines below the line
> const svn_wc_entry_t *parent_entry;
> also should be initialized to NULL like this:
> const svn_wc_entry_t *parent_entry = NULL;
>
No code path in this function uses either of these variables uninitialized.
> That's because the docs (doxygen) say that for
> svn_wc_status_t, the entry could be NULL if not
> under version control, but it's _not_ right now.
>
I'm not sure what you mean.
--ben
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org