perhaps the assert can be removed; should work now

This commit is contained in:
Pierangelo Masarati 2002-11-28 08:25:12 +00:00
parent e918c3b5a7
commit a7c5307279
3 changed files with 6 additions and 2 deletions

View File

@ -123,7 +123,7 @@ ID bdb_tool_entry_put(
assert( text ); assert( text );
assert( text->bv_val ); assert( text->bv_val );
assert( text->bv_val[0] == '\0' ); assert( text->bv_val[0] == '\0' ); /* overconservative? */
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
LDAP_LOG ( TOOLS, ARGS, "=> bdb_tool_entry_put( %ld, \"%s\" )\n", LDAP_LOG ( TOOLS, ARGS, "=> bdb_tool_entry_put( %ld, \"%s\" )\n",

View File

@ -179,7 +179,7 @@ ID ldbm_tool_entry_put(
assert( text ); assert( text );
assert( text->bv_val ); 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 ) { if ( next_id_get( be, &id ) || id == NOID ) {
strncpy( text->bv_val, "unable to get nextid", text->bv_len ); strncpy( text->bv_val, "unable to get nextid", text->bv_len );

View File

@ -59,8 +59,12 @@ main( int argc, char **argv )
Entry *e = str2entry( buf ); Entry *e = str2entry( buf );
struct berval bvtext; struct berval bvtext;
/*
* Initialize text buffer
*/
bvtext.bv_len = textlen; bvtext.bv_len = textlen;
bvtext.bv_val = textbuf; bvtext.bv_val = textbuf;
bvtext.bv_val[0] = '\0';
if( e == NULL ) { if( e == NULL ) {
fprintf( stderr, "%s: could not parse entry (line=%d)\n", fprintf( stderr, "%s: could not parse entry (line=%d)\n",