mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
use memchr in ber_bvchr
This commit is contained in:
parent
215448ac83
commit
2aec424646
@ -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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user