Commit 2aec4246 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

use memchr in ber_bvchr

parent 215448ac
...@@ -83,8 +83,8 @@ ber_pvt_socket_set_nonblock LDAP_P(( ber_socket_t sd, int nb )); ...@@ -83,8 +83,8 @@ ber_pvt_socket_set_nonblock LDAP_P(( ber_socket_t sd, int nb ));
#define ber_strccmp(s,c) \ #define ber_strccmp(s,c) \
( (s)[0] == (c) && (s)[1] == '\0' ) ( (s)[0] == (c) && (s)[1] == '\0' )
LBER_F( char * ) #define ber_bvchr(bv,c) \
ber_bvchr LDAP_P(( struct berval *bv, char c )); memchr( (bv)->bv_val, (c), (bv)->bv_len )
LDAP_END_DECL LDAP_END_DECL
......
...@@ -698,25 +698,3 @@ ber_bvarray_add( BerVarray *a, BerValue *bv ) ...@@ -698,25 +698,3 @@ ber_bvarray_add( BerVarray *a, BerValue *bv )
return n; 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 @@ ...@@ -17,6 +17,7 @@
#include "slap.h" #include "slap.h"
#include "ldap_pvt.h" #include "ldap_pvt.h"
#include "lber_pvt.h"
#include "ldap_utf8.h" #include "ldap_utf8.h"
...@@ -1124,7 +1125,6 @@ retry: ...@@ -1124,7 +1125,6 @@ retry:
} }
p = ber_bvchr( &left, *sub->sa_any[i].bv_val ); p = ber_bvchr( &left, *sub->sa_any[i].bv_val );
if ( p == NULL ) { if ( p == NULL ) {
match = 1; match = 1;
goto done; goto done;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment