From: Frédéric Marchal Date: Sat, 1 Aug 2009 21:07:51 +0000 (+0000) Subject: Fixed bug #2000178. X-Git-Tag: v2_2_6~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06e3cc62905871ef418878c465c1190ee3c97733;p=thirdparty%2Fsarg.git Fixed bug #2000178. --- diff --git a/squidguard_log.c b/squidguard_log.c index 79bc943..38153b4 100644 --- a/squidguard_log.c +++ b/squidguard_log.c @@ -40,6 +40,7 @@ static void read_log(const char *wentp, FILE *fp_ou) char wdata[127]; int idata=0; int i; + char *str; if(debug) { strcpy(buf,text[7]); @@ -70,7 +71,7 @@ static void read_log(const char *wentp, FILE *fp_ou) */ for (i=0; i 0) { strcpy(bufbsf,SquidGuardLogFormat); @@ -131,12 +132,14 @@ static void read_log(const char *wentp, FILE *fp_ou) getword(day,sizeof(day),buf,' ')<0 || getword(hour,sizeof(hour),buf,' ')<0 || getword(list,sizeof(list),buf,'/')<0 || getword(list,sizeof(list),buf,'/')<0 || getword(tmp5,sizeof(tmp5),buf,'/')<0 || getword(tmp5,sizeof(tmp5),buf,'/')<0 || - getword(url,sizeof(url),buf,'/')<0 || getword(tmp5,sizeof(tmp5),buf,' ')<0 || + getword(url,sizeof(url),buf,' ')<0 || getword(ip,sizeof(ip),buf,'/')<0 || getword(user,sizeof(user),buf,' ')<0 || getword(user,sizeof(user),buf,' ')<0) { printf("SARG: Maybe you have a broken record or garbage in your %s file.\n",wentp); exit(1); } + str=strchr(url,'/'); + if (str) *str='\0'; } sprintf(warea,"%s%s%s",year,mon,day);