]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Suppress a false warning
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Wed, 1 Feb 2012 10:18:48 +0000 (11:18 +0100)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Wed, 1 Feb 2012 10:18:48 +0000 (11:18 +0100)
During the creation of the topusers report, if the the report consist
entirely of failed connection without any byte downloaded, the incache
and outcache are both zero and don't sum up to 100%. This is expected and
should not output a warning about corrupted data.

topuser.c

index 24b9b64ea21d62b909a9a67b0fab08f6cb7ba05d..b590b5a620469d61c5845702f9dc59b30f9cce90 100644 (file)
--- a/topuser.c
+++ b/topuser.c
@@ -381,7 +381,7 @@ void topuser(void)
                        ouperc=(tnbytes) ? oucac * 100. / tnbytes : 0.;
                        fprintf(fp_top3,"<td class=\"data\">%3.2lf%%</td><td class=\"data\">%3.2lf%%</td>",inperc,ouperc);
 #ifdef ENABLE_DOUBLE_CHECK_DATA
-                       if (fabs(inperc+ouperc-100.)>=0.01) {
+                       if ((inperc!=0. || ouperc!=0.) && fabs(inperc+ouperc-100.)>=0.01) {
                                debuga(_("The total of the in-cache and cache-miss is not 100%% at position %d (user %s)\n"),posicao,uinfo->label);
                        }
 #endif