From: Wouter Wijngaards Date: Wed, 6 Feb 2008 13:34:59 +0000 (+0000) Subject: Low pop statistics are not good. X-Git-Tag: release-0.9~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fe0251c8db119aa4529631fe383b4ed4d602878;p=thirdparty%2Funbound.git Low pop statistics are not good. git-svn-id: file:///svn/unbound/trunk@926 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/util/timehist.c b/util/timehist.c index d60a6d997..48f3a0d4e 100644 --- a/util/timehist.c +++ b/util/timehist.c @@ -198,7 +198,10 @@ timehist_quartile(struct timehist* hist, double q) if(!hist || hist->num == 0) return 0.; /* look for i'th element, interpolated */ - lookfor = (double)timehist_count(hist) * q; + lookfor = (double)timehist_count(hist); + if(lookfor < 4) + return 0.; /* not enough elements for a good estimate */ + lookfor *= q; passed = 0; i = 0; while(i+1 < hist->num &&