From 8a63ecd93331cab4fd006f0556335d77abddd924 Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Tue, 22 Aug 2000 17:32:07 +0000 Subject: [PATCH] silenced compiled warning about a potentially uninitialized variable; INSIST that the variable is indeed initialized --- lib/dns/sdb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dns/sdb.c b/lib/dns/sdb.c index 9a05e96164..174d4d4ea0 100644 --- a/lib/dns/sdb.c +++ b/lib/dns/sdb.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sdb.c,v 1.3 2000/08/22 01:27:27 gson Exp $ */ +/* $Id: sdb.c,v 1.4 2000/08/22 17:32:07 gson Exp $ */ #include @@ -147,7 +147,8 @@ dns_sdb_register(const char *drivername, dns_sdblookupfunc_t lookup, dns_sdbdestroyfunc_t destroy, void *driverdata, unsigned int flags) { - int i, slot; + int i; + int slot = -1; RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS); REQUIRE(drivername != NULL); @@ -171,6 +172,7 @@ dns_sdb_register(const char *drivername, dns_sdblookupfunc_t lookup, return (ISC_R_NOSPACE); } } + INSIST(slot >= 0 && slot < MAXSDBIMP); imps[slot].drivername = drivername; imps[slot].lookup = lookup; imps[slot].authority = authority;