]> git.sur5r.net Git - openldap/commitdiff
fix bug in previous commit
authorPierangelo Masarati <ando@openldap.org>
Mon, 12 Nov 2001 08:47:09 +0000 (08:47 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 12 Nov 2001 08:47:09 +0000 (08:47 +0000)
libraries/libldap/getdn.c

index ecd30d4c0ddf1eaf43134036d33e8584bc3d365c..8f71949ab7332ad1c47325962bb20065f2935a0a 100644 (file)
@@ -252,8 +252,6 @@ ldap_explode_rdn( LDAP_CONST char *rdn, int notypes )
                        vl = 1 + 2 * ava->la_value->bv_len;
 
                } else {
-                       int rc;
-                       
                        if ( strval2strlen( ava->la_value, 
                                                ava->la_flags, &vl ) ) {
                                goto error_return;
@@ -261,12 +259,13 @@ ldap_explode_rdn( LDAP_CONST char *rdn, int notypes )
                }
                
                if ( !notypes ) {
+                       al = ava->la_attr->bv_len;
                        l = vl + ava->la_attr->bv_len + 1;
 
                        str = LDAP_MALLOC( l + 1 );
                        AC_MEMCPY( str, ava->la_attr->bv_val, 
                                        ava->la_attr->bv_len );
-                       str[ ava->la_attr->bv_len + 1 ] = '=';
+                       str[ al++ ] = '=';
 
                } else {
                        l = vl;