From 0fe0251c8db119aa4529631fe383b4ed4d602878 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Wed, 6 Feb 2008 13:34:59 +0000 Subject: [PATCH] Low pop statistics are not good. git-svn-id: file:///svn/unbound/trunk@926 be551aaa-1e26-0410-a405-d3ace91eadb9 --- util/timehist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 &&