From: Pierangelo Masarati Date: Wed, 3 Apr 2002 15:43:41 +0000 (+0000) Subject: use ber_bvcmp where appropriate X-Git-Tag: OPENLDAP_REL_ENG_2_MP~257 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dd4f10de57bf7bb48a343686e16aef2bdca5c1c1;p=openldap use ber_bvcmp where appropriate --- diff --git a/servers/slapd/back-meta/dncache.c b/servers/slapd/back-meta/dncache.c index b658e964ce..ff8038522e 100644 --- a/servers/slapd/back-meta/dncache.c +++ b/servers/slapd/back-meta/dncache.c @@ -99,12 +99,10 @@ meta_dncache_cmp( struct metadncacheentry *cc1 = ( struct metadncacheentry * )c1; struct metadncacheentry *cc2 = ( struct metadncacheentry * )c2; - int d = cc1->dn.bv_len - cc2->dn.bv_len; - /* * case sensitive, because the dn MUST be normalized */ - return d != 0 ? d : strcmp( cc1->dn.bv_val, cc2->dn.bv_val ); + return ber_bvcmp( &cc1->dn, &cc2->dn); } /* @@ -122,15 +120,10 @@ meta_dncache_dup( struct metadncacheentry *cc1 = ( struct metadncacheentry * )c1; struct metadncacheentry *cc2 = ( struct metadncacheentry * )c2; - int d = cc1->dn.bv_len - cc2->dn.bv_len; - int cmp; - /* * case sensitive, because the dn MUST be normalized */ - cmp = d != 0 ? d : strcmp( cc1->dn.bv_val, cc2->dn.bv_val ); - - return ( cmp == 0 ) ? -1 : 0; + return ( ber_bvcmp( &cc1->dn, &cc2->dn ) == 0 ) ? -1 : 0; } /*