/*
* SARG Squid Analysis Report Generator http://sarg.sourceforge.net
- * 1998, 2013
+ * 1998, 2015
*
* SARG donations:
* please look at http://sarg.sourceforge.net/donations.php
tnincache+=item.incache;
tnoucache+=item.oucache;
}
- fclose(fp_in);
+ if (fclose(fp_in)==EOF) {
+ debuga(_("Read error in \"%s\": %s\n"),wger,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
longline_destroy(&line);
if (olduser[0] != '\0') {
while((warea=longline_read(fp_top1,line))!=NULL) {
getword_start(&gwarea,warea);
if (getword(user,sizeof(user),&gwarea,'\t')<0) {
- debuga(_("There is a broken user in file %s\n"),top1);
+ debuga(_("Invalid user in file \"%s\"\n"),top1);
exit(EXIT_FAILURE);
}
if (getword_atoll(&nbytes,&gwarea,'\t')<0) {
- debuga(_("There is a broken number of bytes in file %s\n"),top1);
+ debuga(_("Invalid number of bytes in file \"%s\"\n"),top1);
exit(EXIT_FAILURE);
}
if (getword_atoll(&nacc,&gwarea,'\t')<0) {
- debuga(_("There is a broken number of access in file %s\n"),top1);
+ debuga(_("Invalid number of accesses in file \"%s\"\n"),top1);
exit(EXIT_FAILURE);
}
if (getword_atoll(&elap,&gwarea,'\t')<0) {
- debuga(_("There is a broken elpased time in file %s\n"),top1);
+ debuga(_("Invalid elapsed time in file \"%s\"\n"),top1);
exit(EXIT_FAILURE);
}
if (getword_atoll(&incac,&gwarea,'\t')<0) {
- debuga(_("There is a broken in-cache size in file %s\n"),top1);
+ debuga(_("Invalid in-cache size in file \"%s\"\n"),top1);
exit(EXIT_FAILURE);
}
if (getword_atoll(&oucac,&gwarea,'\n')<0) {
- debuga(_("There is a broken out-of-cache size in file %s\n"),top1);
+ debuga(_("Invalid out-of-cache size in file \"%s\"\n"),top1);
exit(EXIT_FAILURE);
}
if(nacc < 1)
uinfo=userinfo_find_from_id(user);
if (!uinfo) {
- debuga(_("Unknown user ID %s in file %s\n"),user,top1);
+ debuga(_("Unknown user ID %s in file \"%s\"\n"),user,top1);
exit(EXIT_FAILURE);
}
uinfo->topuser=1;
topcount++;
}
- fclose(fp_top1);
+ if (fclose(fp_top1)==EOF) {
+ debuga(_("Read error in \"%s\": %s\n"),top1,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
if (!KeepTempLog && unlink(top1)) {
debuga(_("Cannot delete \"%s\": %s\n"),top1,strerror(errno));
exit(EXIT_FAILURE);