]> git.sur5r.net Git - openldap/commitdiff
Improve error messages
authorKurt Zeilenga <kurt@openldap.org>
Fri, 16 Jul 2004 21:26:05 +0000 (21:26 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 16 Jul 2004 21:26:05 +0000 (21:26 +0000)
servers/slapd/ad.c

index 89f2c96b6f91db8547262fb2df314c3c7285b06b..ad5ab5c82f7ecb64d182c917d6c4a253483b86ac 100644 (file)
@@ -46,7 +46,7 @@ static int ad_keystring(
 {
        ber_len_t i;
 
-       if( !AD_CHAR( bv->bv_val[0] ) ) {
+       if( !AD_LEADCHAR( bv->bv_val[0] ) ) {
                return 1;
        }
 
@@ -137,14 +137,14 @@ int slap_bv2ad(
        assert( ad != NULL );
        assert( *ad == NULL ); /* temporary */
 
-       if( bv == NULL || bv->bv_len == 0 ) {
-               *text = "empty attribute description";
+       if( bv == NULL || BER_BVISNULL( bv ) || BER_BVISEMPTY( bv ) ) {
+               *text = "empty AttributeDescription";
                return rtn;
        }
 
        /* make sure description is IA5 */
        if( ad_keystring( bv ) ) {
-               *text = "attribute description contains inappropriate characters";
+               *text = "AttributeDescription contains inappropriate characters";
                return rtn;
        }
 
@@ -663,13 +663,13 @@ int slap_bv2undef_ad(
        assert( ad != NULL );
 
        if( bv == NULL || bv->bv_len == 0 ) {
-               *text = "empty attribute description";
+               *text = "empty AttributeDescription";
                return LDAP_UNDEFINED_TYPE;
        }
 
        /* make sure description is IA5 */
        if( ad_keystring( bv ) ) {
-               *text = "attribute description contains inappropriate characters";
+               *text = "AttributeDescription contains inappropriate characters";
                return LDAP_UNDEFINED_TYPE;
        }