Re: [PATCH 2/3] approxidate: handle pending number for "specials"
- From
Carlo Arenas <carenas@gmail.com>
- Date
- Nov 7, 2018, 00:48 UTC
- Message-ID
- <CAPUEspi12TtKxKGr=tutfLPNPWhaZmGCh7q4D1LRJ9LFTWwKNA@mail.gmail.com>
- In-Reply-To
- <20181102052309.GB19234@sigill.intra.peff.net>
On Thu, Nov 1, 2018 at 10:24 PM Jeff King <peff@peff.net> wrote:
>
> static void date_yesterday(struct tm *tm, struct tm *now, int *num)
> {
> + *num = 0;the only caller (date_time) for this sends num = NULL, so this triggers a segfault.
the only reference I could find to that apparently unused parameter comes from: 93cfa7c7a8 ("approxidate_careful() reports errorneous date string", 2010-01-26) and seems to indicate it is optional and therefore a check for NULL might make sense for all other cases
Carlo