]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Don't segfault if date_time_by is empty
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Mon, 3 Jun 2013 10:35:45 +0000 (12:35 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Mon, 3 Jun 2013 10:35:45 +0000 (12:35 +0200)
Thanks to nuphero for reporting this bug and helping in tracking it down.

totday.c

index 2d01186a9102c72b5e105fec94b6ce8d3b1e4f82..e2cee78b6bbfca4fc03ec1fe541ea3a0a1d97a79 100644 (file)
--- 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);