From 4e59f0a671b7ff49a0ee659e4b7ba72d2d00162f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Wed, 1 Feb 2012 11:18:48 +0100 Subject: [PATCH] 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. --- topuser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.2