{
ber_len_t i;
- if( !val->bv_len ) return LDAP_INVALID_SYNTAX;
-
for(i=0; i < val->bv_len; i++) {
if( !SLAP_PRINTABLE(val->bv_val[i]) ) {
return LDAP_INVALID_SYNTAX;
{
ber_len_t i;
- if( !val->bv_len ) return LDAP_INVALID_SYNTAX;
-
for(i=0; i < val->bv_len; i++) {
if( !SLAP_PRINTABLES(val->bv_val[i]) ) {
return LDAP_INVALID_SYNTAX;
{
ber_len_t i;
- if( !val->bv_len ) return LDAP_INVALID_SYNTAX;
-
for(i=0; i < val->bv_len; i++) {
- if( !isascii(val->bv_val[i]) ) return LDAP_INVALID_SYNTAX;
+ if( !LDAP_ASCII(val->bv_val[i]) ) {
+ return LDAP_INVALID_SYNTAX;
+ }
}
return LDAP_SUCCESS;
p++;
}
- if( *p == '\0' ) {
- return LDAP_INVALID_SYNTAX;
- }
-
normalized->bv_val = ch_strdup( p );
p = q = normalized->bv_val;
}
}
- assert( normalized->bv_val < p );
+ assert( normalized->bv_val <= p );
assert( q <= p );
- /* cannot start with a space */
- assert( !ASCII_SPACE(*normalized->bv_val) );
-
/*
* If the string ended in space, backup the pointer one
* position. One is enough because the above loop collapsed
--q;
}
- /* cannot end with a space */
- assert( !ASCII_SPACE( q[-1] ) );
-
/* null terminate */
*q = '\0';