Re: [PATCH] pretty: initialize new cmt_fmt_map to 0
- From
Will Palmer <wmpalmer@gmail.com>
- Date
- May 8, 2010, 22:04 UTC
- Message-ID
- <1273356294.12996.5.camel@walleee>
- In-Reply-To
- <20100508210739.GA6486@progeny.tock>
On Sat, 2010-05-08 at 16:07 -0500, Jonathan Nieder wrote:
Show 15 quoted lines
> Without this change, is_alias is likely to happen to be nonzero, > resulting in "fatal: invalid --pretty format" when the fake alias > cannot be resolved. > > Use memset instead of initializing the members one by one to make it > easier to expand the struct in the future if needed. > > t4205 (log --pretty) does not pass for me without this fix. > > Cc: Will Palmer <wmpalmer@gmail.com> > Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> > --- > Sorry I missed this before. Sane? > > Jonathan
Ah, looks right. I think previous versions of my patch were building in a local variable (which /was/ initialized), then copied the whole thing into the newly-allocated space. When this was changed to building in-place, the initialization was lost. Good catch, thanks.
Not sure if Signed-off-by or Reviewed-by is the appropriate tag to mention here, but one of those, I assume.
-- -- Will