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

Re: [PATCH] Keywords as Hash 3 - libsvn_client

From: John Peacock <jpeacock_at_rowman.com>
Date: 2005-09-21 21:13:32 CEST

Julian Foad wrote:
> Ooh, careful! I think we're both being a bit too hasty here. I was
> just about to commit this, and then happened to go looking at it again
> and noticed this error:
>
>> apr_pool_t *pool)
>> {
>> const svn_wc_entry_t *entry;
>> - svn_subst_keywords_t kw = { 0 };
>> + apr_hash_t *kw;
>
> kw is uninitialised here.

Personally, I prefer to _always_ initialize, just to prevent conditional
codepaths from being added later that break formerly working code. I
think this is probably why I went through and tried to initialize all of
the hashes when I first created the patch. I don't like it when a
variable is defined here and then used more than a screen's worth later,
because you can miss stuff like this.

> There may be more such cases. I'll go looking for them now (in parts 3
> and 4).

Thankfully, 3 and 4 are very minimal changes. Good catch!

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 21 21:13:56 2005

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.