]> git.sur5r.net Git - openldap/commitdiff
perhaps the assert can be removed; should work now
authorPierangelo Masarati <ando@openldap.org>
Thu, 28 Nov 2002 08:25:12 +0000 (08:25 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 28 Nov 2002 08:25:12 +0000 (08:25 +0000)
servers/slapd/back-bdb/tools.c
servers/slapd/back-ldbm/tools.c
servers/slapd/tools/slapadd.c

index 1056944ebd255be7170b73275a5ca7b9c41ac04c..78f2eec5a1dbd28199dd9ddc8d43bdd5a3d0ebfa 100644 (file)
@@ -123,7 +123,7 @@ ID bdb_tool_entry_put(
 
        assert( text );
        assert( text->bv_val );
-       assert( text->bv_val[0] == '\0' );
+       assert( text->bv_val[0] == '\0' );      /* overconservative? */
 
 #ifdef NEW_LOGGING
        LDAP_LOG ( TOOLS, ARGS, "=> bdb_tool_entry_put( %ld, \"%s\" )\n",
index 5d0855bfe53ed749a95d6268b5d6b0854fa572e8..5f415384f19d5ec4781a3f8911f00a792ea7060d 100644 (file)
@@ -179,7 +179,7 @@ ID ldbm_tool_entry_put(
 
        assert( text );
        assert( text->bv_val );
-       assert( text->bv_val[0] == '\0' );
+       assert( text->bv_val[0] == '\0' );      /* overconservative? */
 
        if ( next_id_get( be, &id ) || id == NOID ) {
                strncpy( text->bv_val, "unable to get nextid", text->bv_len );
index 81f81f3f4168f3e2f0bbf3db8d71e5784271416e..1f31d57735385f4f5b0195d30c424622e6c173b9 100644 (file)
@@ -59,8 +59,12 @@ main( int argc, char **argv )
                Entry *e = str2entry( buf );
                struct berval bvtext;
 
+               /*
+                * Initialize text buffer
+                */
                bvtext.bv_len = textlen;
                bvtext.bv_val = textbuf;
+               bvtext.bv_val[0] = '\0';
 
                if( e == NULL ) {
                        fprintf( stderr, "%s: could not parse entry (line=%d)\n",