]> git.sur5r.net Git - openldap/commitdiff
Minor strlen cleanup
authorHoward Chu <hyc@openldap.org>
Sun, 9 Dec 2001 13:57:55 +0000 (13:57 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 9 Dec 2001 13:57:55 +0000 (13:57 +0000)
servers/slapd/sasl.c

index e3fd7fbcd758b1eb388991442f11b22537b89e66..7a3b21921f457295f9efa15f09e121b9f350caae 100644 (file)
@@ -99,9 +99,9 @@ int slap_sasl_getdn( Connection *conn, char *id, char **dnptr, int flags )
 
 
        /* Blatantly anonymous ID */
-       len = strlen( "anonymous" );
-       if( id && !strncasecmp( id, "anonymous", len) && 
-               ( id[len] == '\0' || id[len] == '@' ) ) {
+       len = sizeof( "anonymous" ) - 1;
+       if( id && ( id[len] == '\0' || id[len] == '@' ) &&
+               !strncasecmp( id, "anonymous", len) ) {
                *dnptr = NULL;
                return( LDAP_SUCCESS );
        }