From 5d739b4993e54a1a2a024b55505b6859465f63e4 Mon Sep 17 00:00:00 2001 From: ps Date: Mon, 27 Jun 2011 10:44:45 +0000 Subject: [PATCH] fix small bug in the percentage estimation optimization --- src/Utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index 7c7cac4..acae205 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -488,7 +488,7 @@ bool Utils::listed_on_dns_lists(list& dns_domains,unsigned char percenta } //if we have checked a number of lists that make it impossible for this function //to return true, then return false - if((checked_lists*100/number_of_lists)>100-percentage) + if(((times_listed+(number_of_lists-checked_lists))*100/number_of_lists)>=percentage) { LINF("ip " + ip + " listed on " + Utils::ulongtostr(times_listed) + " out of " + Utils::ulongtostr(checked_lists) + " checked servers, out of " + Utils::ulongtostr(number_of_lists) + ". threshold is " + Utils::ulongtostr(percentage) + "% -> return false"); return false;