Re: [PATCH 2/5] ieot: default to not writing IEOT section
- From
Stefan Beller <sbeller@google.com>
- Date
- Nov 26, 2018, 19:59 UTC
- Message-ID
- <CAGZ79kbaPKaCFGGXnbNchvk=1Q4Q5Hgt2hXOhcGo6pVwquhaEg@mail.gmail.com>
- In-Reply-To
- <05e7df80-0dfc-c1ec-df14-c196357524f4@gmail.com>
Show 6 quoted lines
> > +static int record_ieot(void)
> > +{
> > + int val;
> > +
>
> Initialize stack val to zero to ensure proper default.I don't think that is needed here, as we only use `val` when we first write to it via git_config_get_bool.
Did you spot this via code review and thought of defensive programming or is there a tool that has a false positive here?
Show 5 quoted lines
>
> > + if (!git_config_get_bool("index.recordoffsettable", &val))
> > + return val;
> > + return 0;
> > +}