FILE *fp_in = NULL, *fp_ou = NULL;
+ char buf[MAXLEN];
char *url;
char squidguard_in[MAXLEN];
char per[MAXLEN];
char data[15];
char data2[15];
char hora[15];
+ char ouser2[255];
int z=0;
int count=0;
struct getwordstruct gwarea;
if ((fp_in = fopen(per, "r")) == 0) {
debuga(_("(squidguard) Cannot open file %s\n"),per);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (!fgets(period,sizeof(period),fp_in)) {
debuga(_("(squidguard) read error in %s\n"),per);
- exit(1);
+ exit(EXIT_FAILURE);
}
fclose(fp_in);
if((fp_in=fopen(squidguard_in,"r"))==NULL) {
debuga(_("(squidguard) Cannot open log file %s\n"),squidguard_in);
- exit(1);
+ exit(EXIT_FAILURE);
}
if((fp_ou=fopen(report,"w"))==NULL) {
debuga(_("(squidguard) Cannot open log file %s\n"),report);
- exit(1);
+ exit(EXIT_FAILURE);
}
write_html_header(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 3 : 1,_("SQUIDGUARD"));
if (getword(user,sizeof(user),&gwarea,'\t')<0 || getword(data2,sizeof(data2),&gwarea,'\t')<0 ||
getword(hora,sizeof(hora),&gwarea,'\t')<0 || getword(ip,sizeof(ip),&gwarea,'\t')<0) {
debuga(_("There is a broken record or garbage in file %s\n"),squidguard_in);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (getword_ptr(buf,&url,&gwarea,'\t')<0) {
debuga(_("There is a broken url in file %s\n"),squidguard_in);
- exit(1);
+ exit(EXIT_FAILURE);
}
if (getword(rule,sizeof(rule),&gwarea,'\n')<0) {
debuga(_("There is a broken rule in file %s\n"),squidguard_in);
- exit(1);
+ exit(EXIT_FAILURE);
}
if(UserIp)