From 34214776d121c51b63d4aec33535f950f83d08af Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 26 Dec 2001 06:21:06 +0000 Subject: [PATCH] Minor cleanup --- servers/slapd/ad.c | 2 +- servers/slapd/back-bdb/dn2id.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 7a39fb8f83..7136b420b5 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -122,7 +122,7 @@ int slap_bv2ad( if ( options != NULL ) i = options - name; else - i = strlen(name); + i = bv->bv_len - (name - bv->bv_val); if( i == sizeof("binary")-1 && strncasecmp( name, "binary", i) == 0 ) { if( slap_ad_is_binary( &desc ) ) { diff --git a/servers/slapd/back-bdb/dn2id.c b/servers/slapd/back-bdb/dn2id.c index b35c7c5fe3..b1e8f071dc 100644 --- a/servers/slapd/back-bdb/dn2id.c +++ b/servers/slapd/back-bdb/dn2id.c @@ -32,7 +32,7 @@ bdb_dn2id_add( assert( e->e_id != NOID ); DBTzero( &key ); - key.size = strlen( e->e_ndn ) + 2; + key.size = e->e_nname.bv_len + 2; buf = ch_malloc( key.size ); key.data = buf; buf[0] = DN_BASE_PREFIX; @@ -121,7 +121,7 @@ bdb_dn2id_delete( e->e_ndn, e->e_id, 0 ); DBTzero( &key ); - key.size = strlen( e->e_ndn ) + 2; + key.size = e->e_nname.bv_len + 2; buf = ch_malloc( key.size ); key.data = buf; key.flags = DB_DBT_USERMEM;