From 1b85d17afe49fcb9c8fd2ca732afb59cb5634eda Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 11 Jul 2004 22:55:57 +0000 Subject: [PATCH] minor cleanup --- servers/slapd/back-bdb/search.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index a63a4bae99..4219a8c193 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -149,7 +149,7 @@ static int search_aliases( ID cursora, ida, cursoro, ido, *subscop2; Entry *matched, *a; EntryInfo *ei; - struct berval bv_alias = { sizeof("alias")-1, "alias" }; + struct berval bv_alias = BER_BVC( "alias" ); AttributeAssertion aa_alias; Filter af; DB_LOCK locka, lockr; @@ -504,8 +504,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop, null_attr.an_desc = NULL; null_attr.an_oc = NULL; null_attr.an_oc_exclude = 0; - null_attr.an_name.bv_len = 0; - null_attr.an_name.bv_val = NULL; + BER_BVZERO( &null_attr.an_name ); for( num_ctrls = 0; num_ctrls < SLAP_MAX_RESPONSE_CONTROLS; num_ctrls++ ) { ctrls[num_ctrls] = NULL; @@ -517,8 +516,7 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop, attrs[0].an_desc = NULL; attrs[0].an_oc = NULL; attrs[0].an_oc_exclude = 0; - attrs[0].an_name.bv_len = 0; - attrs[0].an_name.bv_val = NULL; + BER_BVZERO( &attrs[0].an_name ); } manageDSAit = get_manageDSAit( sop ); @@ -555,8 +553,8 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop, ei_root.bei_parent = &ei_root; e_root.e_private = &ei_root; e_root.e_id = 0; - e_root.e_nname.bv_val=""; - e_root.e_name.bv_val=""; + BER_BVSTR( &e_root.e_nname, "" ); + BER_BVSTR( &e_root.e_name, "" ); ei = &ei_root; rs->sr_err = LDAP_SUCCESS; } else { @@ -1654,7 +1652,7 @@ static int search_candidates( { if( !get_manageDSAit(op) && !get_domainScope(op) ) { /* match referral objects */ - struct berval bv_ref = { sizeof("referral")-1, "referral" }; + struct berval bv_ref = BER_BVC( "referral" ); rf.f_choice = LDAP_FILTER_EQUALITY; rf.f_ava = &aa_ref; rf.f_av_desc = slap_schema.si_ad_objectClass; @@ -1678,7 +1676,7 @@ static int search_candidates( #ifdef BDB_SUBENTRIES if( get_subentries_visibility( op ) ) { - struct berval bv_subentry = { sizeof("SUBENTRY")-1, "SUBENTRY" }; + struct berval bv_subentry = BER_BVC( "SUBENTRY" ); sf.f_choice = LDAP_FILTER_EQUALITY; sf.f_ava = &aa_subentry; sf.f_av_desc = slap_schema.si_ad_objectClass; @@ -1761,7 +1759,7 @@ send_paged_response( lastid ? *lastid : 0, rs->sr_nentries, NULL ); #endif - ctrl.ldctl_value.bv_val = NULL; + BER_BVZERO( &ctrl.ldctl_value ); ctrls[0] = &ctrl; ctrls[1] = NULL; @@ -1774,8 +1772,7 @@ send_paged_response( } else { respcookie = ( PagedResultsCookie )0; - cookie.bv_val = ""; - cookie.bv_len = 0; + BER_BVSTR( &cookie, "" ); } op->o_conn->c_pagedresults_state.ps_cookie = respcookie; -- 2.39.5