X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=repday.c;h=9a412609b0c2a3f6ce7c2519dd4a848158ec7ace;hb=507460aefaddc24a2e53a9f4a6399098c23dc7c5;hp=08cff9ec0dc00755f7b9de382a889b30bb65710d;hpb=5f46190e0e20b982462ab90d4d17e3db73e47fba;p=thirdparty%2Fsarg.git diff --git a/repday.c b/repday.c index 08cff9e..9a41260 100644 --- a/repday.c +++ b/repday.c @@ -1,6 +1,6 @@ /* * SARG Squid Analysis Report Generator http://sarg.sourceforge.net - * 1998, 2011 + * 1998, 2012 * * SARG donations: * please look at http://sarg.sourceforge.net/donations.php @@ -66,7 +66,7 @@ void report_day(const struct userinfostruct *uinfo) } if((fp_in=fopen(wdirname,"r"))==NULL) { - debuga(_("(repday) Cannot open log file %s\n"),wdirname); + debuga(_("(repday) Cannot open log file %s: %s\n"),wdirname,strerror(errno)); exit(EXIT_FAILURE); } @@ -119,7 +119,7 @@ void report_day(const struct userinfostruct *uinfo) fclose(fp_in); if((fp_ou=fopen(arqout,"w"))==NULL) { - debuga(_("(repday) Cannot open log file %s\n"),arqout); + debuga(_("(repday) Cannot open log file %s: %s\n"),arqout,strerror(errno)); exit(EXIT_FAILURE); } @@ -140,8 +140,11 @@ void report_day(const struct userinfostruct *uinfo) label=_("BYTES"); fputs("
",fp_ou); - for( i = 0; i < hours.len; i++ ) - fprintf(fp_ou, " | %02d%s %s | \n", hours.list[ i ], _("H"), label );
+ for( i = 0; i < hours.len; i++ ) {
+ /* TRANSLATORS: It is an hour in the hourly report */
+ sprintf(data,_("%02dH"),hours.list[ i ]);
+ fprintf(fp_ou, "%s %s | \n", data, label );
+ }
fprintf(fp_ou, "%s %s | %s | \n",fixnum(tt,1)); fputs("
---|
",fp_ou); - for( i = 0; i < hours.len; i++ ) - fprintf(fp_ou, " | %02d%s %s | \n", hours.list[ i ], _("H"), label );
+ for( i = 0; i < hours.len; i++ ) {
+ sprintf(data,_("%02dH"),hours.list[ i ]);
+ fprintf(fp_ou, "%s %s | \n", data, label );
+ }
fprintf(fp_ou, "%s %s | %s | \n",fixtime(tt)); fputs("
---|