From 94b6a6944045c0f5a026e674d62c652b2b8af7ed Mon Sep 17 00:00:00 2001 From: Frederic Marchal Date: Mon, 3 Jun 2013 12:35:45 +0200 Subject: [PATCH] Don't segfault if date_time_by is empty Thanks to nuphero for reporting this bug and helping in tracking it down. --- totday.c | 1 + 1 file changed, 1 insertion(+) diff --git a/totday.c b/totday.c index 2d01186..e2cee78 100644 --- a/totday.c +++ b/totday.c @@ -100,6 +100,7 @@ void day_addpoint(DayObject ddata,const char *date, const char *time, long long int dayidx; int i; + if (!ddata) return; if (sscanf(date,"%d/%d/%d",&day,&month,&year)!=3) { debuga(_("Invalid date \"%s\" for the hourly statistics\n"),date); exit(EXIT_FAILURE); -- 2.47.2