From 3be2705a12ad7ccdfe7a9e9b187df09a25e6f0bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Sat, 8 Jan 2011 20:35:55 +0000 Subject: [PATCH] Take the time into account when parsing sarg and isa logs The time was ignored when parsing the sarg and isa logs. The result was that all the access times were reported as occuring at 00:00. Thanks to kodemi for reporting this bug. --- log.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/log.c b/log.c index c93f795..c1565bc 100644 --- a/log.c +++ b/log.c @@ -1110,6 +1110,11 @@ int main(int argc,char *argv[]) } idata=builddia(iday,imonth,iyear); computedate(iyear,imonth,iday,&tt); + if (sscanf(hora,"%d:%d:%d",&tt.tm_hour,&tt.tm_min,&tt.tm_sec)!=3 || tt.tm_hour<0 || tt.tm_hour>=24 || + tt.tm_min<0 || tt.tm_min>=60 || tt.tm_sec<0 || tt.tm_sec>=60) { + debuga(_("Invalid time found in %s\n"),arq); + exit(EXIT_FAILURE); + } t=&tt; } if (ilf==ILF_Isa) { @@ -1221,6 +1226,13 @@ int main(int argc,char *argv[]) idata=builddia(iday,imonth,iyear); computedate(iyear,imonth,iday,&tt); + if (isa_cols[ISACOL_Time]>=0) { + if (sscanf(hora,"%d:%d:%d",&tt.tm_hour,&tt.tm_min,&tt.tm_sec)!=3 || tt.tm_hour<0 || tt.tm_hour>=24 || + tt.tm_min<0 || tt.tm_min>=60 || tt.tm_sec<0 || tt.tm_sec>=60) { + debuga(_("Invalid time found in %s\n"),arq); + exit(EXIT_FAILURE); + } + } t=&tt; } if (t==NULL) { -- 2.47.2