From 1ed3e846a2c357dbdea6cc8ea4f0f9e9d06f6aa4 Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Wed, 6 Sep 2000 23:16:14 +0000 Subject: [PATCH] make the initial iterator state of rdatasets undefined so that we can detect cases where the user fails to call dns_rdataset_first() before calling dns_rdataset_current() --- lib/dns/rbtdb.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 42211c53e3..8db7aa82b5 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.123 2000/09/06 02:39:57 explorer Exp $ */ +/* $Id: rbtdb.c,v 1.124 2000/09/06 23:16:14 gson Exp $ */ /* * Principal Author: Bob Halley @@ -1168,19 +1168,12 @@ bind_rdataset(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node, rdataset->private3 = raw; count = raw[0] * 256 + raw[1]; raw += 2; - if (count == 0) { - rdataset->private4 = (void *)0; - rdataset->private5 = NULL; - } else { - /* - * The private4 field is the number of rdata beyond - * the cursor position, so we decrement the total - * count by one before storing it. - */ - count--; - rdataset->private4 = (void *)count; - rdataset->private5 = raw; - } + + /* + * Reset iterator state. + */ + rdataset->private4 = NULL; + rdataset->private5 = NULL; } static inline isc_result_t