use memchr in ber_bvchr

This commit is contained in:
Pierangelo Masarati 2002-02-14 21:10:13 +00:00
parent 215448ac83
commit 2aec424646
3 changed files with 3 additions and 25 deletions

View File

@ -83,8 +83,8 @@ ber_pvt_socket_set_nonblock LDAP_P(( ber_socket_t sd, int nb ));
#define ber_strccmp(s,c) \
( (s)[0] == (c) && (s)[1] == '\0' )
LBER_F( char * )
ber_bvchr LDAP_P(( struct berval *bv, char c ));
#define ber_bvchr(bv,c) \
memchr( (bv)->bv_val, (c), (bv)->bv_len )
LDAP_END_DECL

View File

@ -698,25 +698,3 @@ ber_bvarray_add( BerVarray *a, BerValue *bv )
return n;
}
char *
ber_bvchr( struct berval *bv, char c )
{
ber_len_t p;
assert( bv );
if ( bv->bv_len == 0 ) {
return NULL;
}
assert( bv->bv_val );
for ( p = 0; p < bv->bv_len; p++ ) {
if ( bv->bv_val[ p ] == c ) {
return &bv->bv_val[ p ];
}
}
return NULL;
}

View File

@ -17,6 +17,7 @@
#include "slap.h"
#include "ldap_pvt.h"
#include "lber_pvt.h"
#include "ldap_utf8.h"
@ -1124,7 +1125,6 @@ retry:
}
p = ber_bvchr( &left, *sub->sa_any[i].bv_val );
if ( p == NULL ) {
match = 1;
goto done;