]> git.sur5r.net Git - openldap/commitdiff
Fix prev commit
authorHoward Chu <hyc@openldap.org>
Thu, 17 Apr 2003 05:15:12 +0000 (05:15 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 17 Apr 2003 05:15:12 +0000 (05:15 +0000)
servers/slapd/back-bdb/dbcache.c

index 3eddc2ab1a29537deb82b9c8d4abdc8809b381c7..7c99c19196c6968602eb03d940cc2fce85cfa8f7 100644 (file)
@@ -62,7 +62,7 @@ bdb_db_cache(
 
        *dbout = NULL;
 
-       for( i=BDB_NDB; i < BDB_INDICES && bdb->bi_databases[i]; i++ ) {
+       for( i=BDB_NDB; i < bdb->bi_ndatabases; i++ ) {
                if( !strcmp( bdb->bi_databases[i]->bdi_name, name) ) {
                        *dbout = bdb->bi_databases[i]->bdi_db;
                        return 0;
@@ -86,7 +86,7 @@ bdb_db_cache(
        if (rc) return rc;
 
        /* check again! may have been added by another thread */
-       for( i=BDB_NDB; i < BDB_INDICES && bdb->bi_databases[i]; i++ ) {
+       for( i=BDB_NDB; i < bdb->bi_ndatabases; i++ ) {
                if( !strcmp( bdb->bi_databases[i]->bdi_name, name) ) {
                        *dbout = bdb->bi_databases[i]->bdi_db;
                        LOCK_PUT( bdb->bi_dbenv, &lock);