Fix bug in last commit

This commit is contained in:
Kurt Zeilenga 2002-08-27 02:43:00 +00:00
parent 433eb54dc7
commit 6ec6115119
2 changed files with 7 additions and 8 deletions

View File

@ -550,7 +550,7 @@ int structural_class(
*scbv = ocs[scn]; *scbv = ocs[scn];
if( scbv->bv_len ) { if( scbv->bv_len == 0 ) {
*text = "invalid structural object class"; *text = "invalid structural object class";
return LDAP_OBJECT_CLASS_VIOLATION; return LDAP_OBJECT_CLASS_VIOLATION;
} }

View File

@ -119,13 +119,12 @@ main( int argc, char **argv )
if( sc == NULL ) { if( sc == NULL ) {
struct berval vals[2]; struct berval vals[2];
/* int ret = */ rc = structural_class( oc->a_vals, vals,
structural_class( oc->a_vals, vals,
NULL, &text, textbuf, textlen ); NULL, &text, textbuf, textlen );
if( vals[0].bv_len == 0 ) { if( rc != LDAP_SUCCESS ) {
fprintf( stderr, "%s: dn=\"%s\" (line=%d): %s\n", fprintf( stderr, "%s: dn=\"%s\" (line=%d): (%d) %s\n",
progname, e->e_dn, lineno, text ); progname, e->e_dn, lineno, rc, text );
rc = EXIT_FAILURE; rc = EXIT_FAILURE;
entry_free( e ); entry_free( e );
if( continuemode ) continue; if( continuemode ) continue;
@ -141,8 +140,8 @@ main( int argc, char **argv )
rc = entry_schema_check( be, e, NULL, &text, textbuf, textlen ); rc = entry_schema_check( be, e, NULL, &text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) { if( rc != LDAP_SUCCESS ) {
fprintf( stderr, "%s: dn=\"%s\" (line=%d): %s\n", fprintf( stderr, "%s: dn=\"%s\" (line=%d): (%d) %s\n",
progname, e->e_dn, lineno, text ); progname, e->e_dn, lineno, rc, text );
rc = EXIT_FAILURE; rc = EXIT_FAILURE;
entry_free( e ); entry_free( e );
if( continuemode ) continue; if( continuemode ) continue;