From: Frédéric Marchal Date: Wed, 1 Feb 2012 10:18:48 +0000 (+0100) Subject: Suppress a false warning X-Git-Tag: v2.3.3-pre1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e59f0a671b7ff49a0ee659e4b7ba72d2d00162f;p=thirdparty%2Fsarg.git Suppress a false warning 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. --- diff --git a/topuser.c b/topuser.c index 24b9b64..b590b5a 100644 --- a/topuser.c +++ b/topuser.c @@ -381,7 +381,7 @@ void topuser(void) ouperc=(tnbytes) ? oucac * 100. / tnbytes : 0.; fprintf(fp_top3,"%3.2lf%%%3.2lf%%",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