From: Wouter Wijngaards Date: Mon, 18 Jun 2007 12:32:16 +0000 (+0000) Subject: Another offbyone. X-Git-Tag: release-0.4~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a629da2c3130af72c5f010fc86d2097a89ca65a;p=thirdparty%2Funbound.git Another offbyone. git-svn-id: file:///svn/unbound/trunk@393 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 9923f7397..496a2e3b6 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 18 June 2007: Wouter - same, move subqueries to slumber list when first has resolved. - fixup last fix for duplicate callbacks. + - another offbyone in targetcounter. Also in Java prototype by the way. 15 June 2007: Wouter - if a query asks to be notified of the same serviced query result diff --git a/iterator/iterator.c b/iterator/iterator.c index 97538f1d8..b31e9dcd3 100644 --- a/iterator/iterator.c +++ b/iterator/iterator.c @@ -897,6 +897,7 @@ query_for_targets(struct module_qstate* qstate, struct iter_qstate* iq, int query_count = 0; int target_count = 0; struct delegpt_ns* ns = iq->dp->nslist; + log_assert(maxtargets != 0); /* that would not be useful */ /* Generate target requests. Basically, any missing targets * are queried for here, regardless if it is necessary to do @@ -940,7 +941,7 @@ query_for_targets(struct module_qstate* qstate, struct iter_qstate* iq, /* if maxtargets is negative, there is no maximum, * otherwise only query for ntarget names. */ - if(maxtargets >= 0 && ++target_count > maxtargets) + if(maxtargets >= 0 && ++target_count >= maxtargets) break; } *num = query_count;