From: Will Palmer Date: Sat, 08 May 2010 22:04:54 GMT Subject: Re: [PATCH] pretty: initialize new cmt_fmt_map to 0 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: > 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 > Signed-off-by: Jonathan Nieder > --- > 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