From: Kurt Zeilenga Date: Sun, 5 Sep 1999 22:32:01 +0000 (+0000) Subject: Further trim_refs_url fixes from Hallvard. Need additional testing. X-Git-Tag: TWEB_OL_BASE~18 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b660f54bb4c1e17be14e57e2e4811362986e0a10;p=openldap Further trim_refs_url fixes from Hallvard. Need additional testing. --- diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 7580a579e0..f5038ac540 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -78,12 +78,12 @@ static void trim_refs_urls( if( refs == NULL ) return; for( i=0; refs[i] != NULL; i++ ) { - if( refs[i]->bv_len > sizeof("ldap://") && + if( refs[i]->bv_len > sizeof("ldap://")-1 && strncasecmp( refs[i]->bv_val, "ldap://", sizeof("ldap://")-1 ) == 0 ) { unsigned j; - for( j=sizeof("ldap://"); jbv_len ; j++ ) { + for( j=sizeof("ldap://")-1; jbv_len ; j++ ) { if( refs[i]->bv_val[j] == '/' ) { refs[i]->bv_val[j] = '\0'; refs[i]->bv_len = j;