From: Frederic Marchal Date: Tue, 17 Nov 2015 18:34:44 +0000 (+0100) Subject: Extract the starting date from a parsed log file X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0181c862fdd5fb0d92a88487629fbb434c6cafcf;p=thirdparty%2Fsarg.git Extract the starting date from a parsed log file The period covered by a parsed log file is coded in its file name but the start date was not properly saved resulting in reports allegedly generated for 1900-1-1. Thanks to Evgeniy Yakushev for reporting this problem. --- diff --git a/util.c b/util.c index 3e423b5..aba23b1 100644 --- a/util.c +++ b/util.c @@ -1085,7 +1085,7 @@ void getperiod_merge(struct periodstruct *main,struct periodstruct *candidate) mdate=(main->start.tm_year)*10000+(main->start.tm_mon)*100+main->start.tm_mday; cdate=(candidate->start.tm_year)*10000+(candidate->start.tm_mon)*100+candidate->start.tm_mday; - if (cdatestart,&candidate->start,sizeof(struct tm)); + if (mdate==0 || cdatestart,&candidate->start,sizeof(struct tm)); mdate=(main->end.tm_year)*10000+(main->end.tm_mon)*100+main->end.tm_mday; cdate=(candidate->end.tm_year)*10000+(candidate->end.tm_mon)*100+candidate->end.tm_mday;