/*
* AUTHOR: Pedro Lineu Orso pedro.orso@gmail.com
- * 1998, 2009
+ * 1998, 2010
* SARG Squid Analysis Report Generator http://sarg.sourceforge.net
*
* SARG donations:
char *str;
int z=0;
int count=0;
+ struct getwordstruct gwarea;
ouser[0]='\0';
ouser2[0]='\0';
fprintf(fp_ou,"<tr><th class=\"header\">%s</th><th class=\"header\">%s</th><th class=\"header\">%s</th><th class=\"header\">%s</th></tr>\n",text[98],text[111],text[110],text[91]);
while(fgets(buf,sizeof(buf),fp_in)!=NULL) {
- if (getword(data,sizeof(data),buf,'\t')<0 || getword(hora,sizeof(hora),buf,'\t')<0 ||
- getword(user,sizeof(user),buf,'\t')<0 || getword(ip,sizeof(ip),buf,'\t')<0 ||
- getword(url,sizeof(url),buf,'\t')<0) {
+ getword_start(&gwarea,buf);
+ if (getword(data,sizeof(data),&gwarea,'\t')<0 || getword(hora,sizeof(hora),&gwarea,'\t')<0 ||
+ getword(user,sizeof(user),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0 ||
+ getword(url,sizeof(url),&gwarea,'\t')<0) {
printf("SARG: Maybe you have a broken record or garbage in your %s file.\n",denied_in);
exit(1);
}
fixip(user);
}
- if(strcmp(Ip2Name,"yes") == 0)
+ if(Ip2Name)
ip2name(ip,sizeof(ip));
if(!z) {
continue;
}
- if(strlen(BlockIt) > 0)
+ if(BlockIt[0] != '\0')
sprintf(BlockImage,"<a href=\"%s%s?url=%s\"><img src=\"%s/sarg-squidguard-block.png\" border=\"0\"></a> ",wwwDocumentRoot,BlockIt,url,ImageFile);
else BlockImage[0]='\0';