]> git.sur5r.net Git - openldap/commitdiff
Minor cleanup
authorHoward Chu <hyc@openldap.org>
Wed, 26 Dec 2001 06:21:06 +0000 (06:21 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 26 Dec 2001 06:21:06 +0000 (06:21 +0000)
servers/slapd/ad.c
servers/slapd/back-bdb/dn2id.c

index 7a39fb8f83aa250ee5bcce3ac46c80b4a5bc87d7..7136b420b5b0558684a73c0070b94907d3683d03 100644 (file)
@@ -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 ) ) {
index b35c7c5fe3315fd02c9b0451ecaee27e2bf8c072..b1e8f071dce8a57aeb3bb941155eb5cfedec41e0 100644 (file)
@@ -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;