Re: [PATCH 2/3] approxidate: handle pending number for "specials"
From: Carlo Arenas <hidden>
Date: 2018-11-07 00:48:43
From: Carlo Arenas <hidden>
Date: 2018-11-07 00:48:43
On Thu, Nov 1, 2018 at 10:24 PM Jeff King [off-list ref] 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