char arqin[MAXLEN], arqou[MAXLEN], arqper[MAXLEN], arqip[MAXLEN];
char *url, tmsg[50], csort[MAXLEN];
char user[MAXLEN], duser[MAXLEN];
- char userhora[9], userdia[9];
char user_ip[MAXLEN], olduserip[MAXLEN], tmp2[MAXLEN], tmp3[MAXLEN];
char denied_report[255];
char *str;
exit(EXIT_FAILURE);
}
while((buf=longline_read(fp_ip,line1))!=NULL) {
- if(strstr(buf,url) != 0)
- fputs(buf,fp_ip2);
+ if(strstr(buf,url) != 0) {
+ fprintf(fp_ip2,"%s\n",buf);
+ }
}
longline_destroy(&line1);
debuga(_("Maybe you have a broken url in your %s file\n"),tmp3);
exit(EXIT_FAILURE);
}
- if (getword(userdia,sizeof(userdia),&gwarea,'\t')<0) {
+ if (getword_skip(15,&gwarea,'\t')<0) {
debuga(_("Maybe you have a broken day in your %s file\n"),tmp3);
exit(EXIT_FAILURE);
}
- if (getword(userhora,sizeof(userhora),&gwarea,'\t')<0) {
+ if (getword_skip(15,&gwarea,'\t')<0) {
debuga(_("Maybe you have a broken time in your %s file\n"),tmp3);
exit(EXIT_FAILURE);
}
debuga(_("Maybe you have a broken size in your %s file\n"),tmp3);
exit(EXIT_FAILURE);
}
- if (getword_atoll(&userelap,&gwarea,'\t')<0) {
+ if (getword_atoll(&userelap,&gwarea,'\0')<0) {
debuga(_("Maybe you have a broken elapsed time in your %s file\n"),tmp3);
exit(EXIT_FAILURE);
}
if(strcmp(user_ip,olduserip) != 0) {
- sprintf(wwork1,"%s",fixnum(unbytes,1));
- /*
- This complicated printf is due to Microsoft's inability to comply with any standard. Msvcrt is unable
- to print a long long int unless it is exactly 64-bits long.
- */
- fprintf(fp_ou,"<tr><td></td><td class=\"data\">%s</td><td></td><td class=\"data\">%s</td><td></td><td></td><td></td><td class=\"data\">%s</td><td class=\"data\">%"PRIu64"</td></tr>\n",olduserip,wwork1,buildtime(unelap),(uint64_t)unelap);
+ if (olduserip[0]!='\0') {
+ fprintf(fp_ou,"<tr><td></td><td class=\"data\">%s</td>",olduserip);
+ if((UserReportFields & USERREPORTFIELDS_CONNECT) != 0)
+ fputs("<td></td>",fp_ou);
+ if((UserReportFields & USERREPORTFIELDS_BYTES) != 0)
+ fprintf(fp_ou,"<td class=\"data\">%s</td>",fixnum(unbytes,1));
+ if((UserReportFields & USERREPORTFIELDS_SETYB) != 0)
+ fputs("<td></td>",fp_ou);
+ if((UserReportFields & USERREPORTFIELDS_IN_CACHE_OUT) != 0)
+ fputs("</td><td></td><td></td>",fp_ou);
+ if((UserReportFields & USERREPORTFIELDS_USED_TIME) != 0)
+ fprintf(fp_ou,"<td class=\"data\">%s</td>",buildtime(unelap));
+ if((UserReportFields & USERREPORTFIELDS_MILISEC) != 0)
+ fprintf(fp_ou,"<td class=\"data\">%s</td>",fixnum2(unelap,1));
+ fputs("</tr>\n",fp_ou);
+ }
strcpy(olduserip,user_ip);
unacc=0;
unelap=0;
}
- unbytes=unbytes+userbytes;
- unelap=unelap+userelap;
+ unbytes+=userbytes;
+ unelap+=userelap;
}
fclose(fp_ip);
unlink(tmp2);
unlink(tmp3);
- sprintf(wwork1,"%s",fixnum(unbytes,1));
- /*
- This complicated printf is due to Microsoft's inability to comply with any standard. Msvcrt is unable
- to print a long long int unless it is exactly 64-bits long.
- */
- fprintf(fp_ou,"<tr><td></td><td class=\"data\">%s</td><td></td><td class=\"data\">%s</td><td></td><td></td><td></td><td class=\"data\">%s</td><td class=\"data\">%"PRIu64"</td></tr>\n",olduserip,wwork1,buildtime(unelap),(uint64_t)unelap);
+ if (olduserip[0]!='\0') {
+ fprintf(fp_ou,"<tr><td></td><td class=\"data\">%s</td>",olduserip);
+ if((UserReportFields & USERREPORTFIELDS_CONNECT) != 0)
+ fputs("<td></td>",fp_ou);
+ if((UserReportFields & USERREPORTFIELDS_BYTES) != 0)
+ fprintf(fp_ou,"<td class=\"data\">%s</td>",fixnum(unbytes,1));
+ if((UserReportFields & USERREPORTFIELDS_SETYB) != 0)
+ fputs("<td></td>",fp_ou);
+ if((UserReportFields & USERREPORTFIELDS_IN_CACHE_OUT) != 0)
+ fputs("</td><td></td><td></td>",fp_ou);
+ if((UserReportFields & USERREPORTFIELDS_USED_TIME) != 0)
+ fprintf(fp_ou,"<td class=\"data\">%s</td>",buildtime(unelap));
+ if((UserReportFields & USERREPORTFIELDS_MILISEC) != 0)
+ fprintf(fp_ou,"<td class=\"data\">%s</td>",fixnum2(unelap,1));
+ fputs("</tr>\n",fp_ou);
+ }
}
unacc=0;