]> git.sur5r.net Git - openldap/commitdiff
refine prev commit
authorHoward Chu <hyc@openldap.org>
Mon, 8 May 2006 13:12:12 +0000 (13:12 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 8 May 2006 13:12:12 +0000 (13:12 +0000)
servers/slapd/ad.c

index 46be761d9f603d2301834cd64b6f77c6b8a0f999..c9601a3a10b33be83fd806f5a9ae55763d0d4c48 100644 (file)
@@ -124,21 +124,21 @@ int slap_str2ad(
 }
 
 static char *strchrlen(
-       const char *p
+       const char *beg
        const char *end,
        const char ch, 
        int *len )
 {
-       int i;
+       const char *p;
 
-       for( i=0; *p && p < end; i++,p++ ) {
+       for( p=beg; *p && p < end; p++ ) {
                if( *p == ch ) {
-                       *len = i;
+                       *len = p - beg;
                        return (char *) p;
                }
        }
 
-       *len = i;
+       *len = p - beg;
        return NULL;
 }