]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Fix the filtering out of the log based on a date
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 27 Aug 2012 12:31:33 +0000 (14:31 +0200)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 27 Aug 2012 12:31:33 +0000 (14:31 +0200)
The date range was ignored and, in the worst case, no entries were
reported.

readlog.c
readlog_common.c
readlog_extlog.c

index 16e68596f8fb1da2144c9019f9ba1f99285e15c7..2f7cb68c83f4d92e4b8a6f05a98a044130d0a283 100644 (file)
--- a/readlog.c
+++ b/readlog.c
@@ -332,6 +332,7 @@ int ReadLogFile(struct ReadLogDataStruct *Filter)
                                break;
                        }
 
+                       idata=builddia(log_entry.EntryTime.tm_mday,log_entry.EntryTime.tm_mon+1,log_entry.EntryTime.tm_year+1900);
                        if(debugm)
                                printf("DATE=%s IDATA=%d DFROM=%d DUNTIL=%d\n",Filter->DateRange,idata,dfrom,duntil);
 
index 39753da8f4ea529e71171f0247dde3d9fcb0f54e..9dcaff0ef91f66e7230573ef95c07def87e2e027 100644 (file)
@@ -142,7 +142,7 @@ static enum ReadLogReturnCodeEnum Common_ReadEntry(char *Line,struct ReadLogStru
        if (*Line!=']') return(RLRC_Unknown);
 
        Entry->EntryTime.tm_year=Year-1900;
-       Entry->EntryTime.tm_mon=Month;
+       Entry->EntryTime.tm_mon=Month-1;
        Entry->EntryTime.tm_mday=Day;
        Entry->EntryTime.tm_hour=Hour;
        Entry->EntryTime.tm_min=Minute;
index 91c86289832b20a007326404cf67fbcde06d6e4a..dde2b3173b83de8f9615bc7b22a7580c23ca8f65 100644 (file)
@@ -262,7 +262,7 @@ static char *ExtLog_GetDate(char *Line,struct tm *Date)
                ++Line;
        }
        Date->tm_year=year-1900;
-       Date->tm_mon=month;
+       Date->tm_mon=month-1;
        Date->tm_mday=day;
        return(Line);
 }