]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/dn.c
ITS#6932: Clean up strange asserts & nearby code.
[openldap] / servers / slapd / dn.c
index 74bd594e7602634d68bad0ee7440a0307e9e18d6..cb4c6951655718bf4b97b278512bea16fa2ec61b 100644 (file)
@@ -703,11 +703,10 @@ dnPrettyNormal(
        struct berval *normal,
        void *ctx)
 {
-       Debug( LDAP_DEBUG_TRACE, ">>> dnPrettyNormal: <%s>\n", val->bv_val ? val->bv_val : "", 0, 0 );
-
        assert( val != NULL );
        assert( pretty != NULL );
        assert( normal != NULL );
+       Debug( LDAP_DEBUG_TRACE, ">>> dnPrettyNormal: <%s>\n", val->bv_val ? val->bv_val : "", 0, 0 );
 
        if ( val->bv_len == 0 ) {
                ber_dupbv_x( pretty, val, ctx );
@@ -1169,11 +1168,13 @@ dnIsSuffix(
        const struct berval *dn,
        const struct berval *suffix )
 {
-       int     d = dn->bv_len - suffix->bv_len;
+       int     d;
 
        assert( dn != NULL );
        assert( suffix != NULL );
 
+       d = dn->bv_len - suffix->bv_len;
+
        /* empty suffix matches any dn */
        if ( suffix->bv_len == 0 ) {
                return 1;