Warning cleanup: signed meets unsigned. ber_flatten2() returns -1 on

error, not LBER_DEFAULT.
This commit is contained in:
Hallvard Furuseth 2008-10-13 09:17:36 +00:00
parent 1c85cf3c88
commit b6f83f1a25
3 changed files with 9 additions and 9 deletions

View File

@ -534,17 +534,17 @@ log_age_unparse( int age, struct berval *agebv, size_t size )
if ( dd ) { if ( dd ) {
len = snprintf( ptr, size, "%d+", dd ); len = snprintf( ptr, size, "%d+", dd );
assert( len >= 0 && len < size ); assert( len >= 0 && (unsigned) len < size );
size -= len; size -= len;
ptr += len; ptr += len;
} }
len = snprintf( ptr, size, "%02d:%02d", hh, mm ); len = snprintf( ptr, size, "%02d:%02d", hh, mm );
assert( len >= 0 && len < size ); assert( len >= 0 && (unsigned) len < size );
size -= len; size -= len;
ptr += len; ptr += len;
if ( ss ) { if ( ss ) {
len = snprintf( ptr, size, ":%02d", ss ); len = snprintf( ptr, size, ":%02d", ss );
assert( len >= 0 && len < size ); assert( len >= 0 && (unsigned) len < size );
size -= len; size -= len;
ptr += len; ptr += len;
} }
@ -580,7 +580,7 @@ log_old_lookup( Operation *op, SlapReply *rs )
a = attr_find( rs->sr_entry->e_attrs, a = attr_find( rs->sr_entry->e_attrs,
slap_schema.si_ad_entryCSN ); slap_schema.si_ad_entryCSN );
if ( a ) { if ( a ) {
int len = a->a_vals[0].bv_len; ber_len_t len = a->a_vals[0].bv_len;
if ( len > pd->csn.bv_len ) if ( len > pd->csn.bv_len )
len = pd->csn.bv_len; len = pd->csn.bv_len;
if ( memcmp( a->a_vals[0].bv_val, pd->csn.bv_val, len ) > 0 ) { if ( memcmp( a->a_vals[0].bv_val, pd->csn.bv_val, len ) > 0 ) {
@ -933,7 +933,7 @@ logSchemaControlValidate(
struct berval *valp ) struct berval *valp )
{ {
struct berval val, bv; struct berval val, bv;
int i; ber_len_t i;
int rc = LDAP_SUCCESS; int rc = LDAP_SUCCESS;
assert( valp != NULL ); assert( valp != NULL );
@ -1155,7 +1155,7 @@ accesslog_ctrls(
} }
if ( !BER_BVISNULL( &ctrls[ i ]->ldctl_value ) ) { if ( !BER_BVISNULL( &ctrls[ i ]->ldctl_value ) ) {
int j; ber_len_t j;
ptr = lutil_strcopy( ptr, " controlValue \"" ); ptr = lutil_strcopy( ptr, " controlValue \"" );
for ( j = 0; j < ctrls[ i ]->ldctl_value.bv_len; j++ ) for ( j = 0; j < ctrls[ i ]->ldctl_value.bv_len; j++ )

View File

@ -877,7 +877,7 @@ dynlist_build_def_filter( dynlist_info_t *dli )
ptr = lutil_strcopy( ptr, dli->dli_oc->soc_cname.bv_val ); ptr = lutil_strcopy( ptr, dli->dli_oc->soc_cname.bv_val );
ptr = lutil_strcopy( ptr, "))" ); ptr = lutil_strcopy( ptr, "))" );
assert( dli->dli_default_filter.bv_len == ptr - dli->dli_default_filter.bv_val ); assert( ptr == &dli->dli_default_filter.bv_val[dli->dli_default_filter.bv_len] );
return 0; return 0;
} }

View File

@ -395,7 +395,7 @@ create_passcontrol( Operation *op, int exptime, int grace, LDAPPasswordPolicyErr
} }
ber_printf( ber, /*{*/ "N}" ); ber_printf( ber, /*{*/ "N}" );
if (ber_flatten2( ber, &(c.ldctl_value), 1 ) == LBER_DEFAULT) { if (ber_flatten2( ber, &(c.ldctl_value), 1 ) == -1) {
return NULL; return NULL;
} }
(void)ber_free_buf(ber); (void)ber_free_buf(ber);
@ -679,7 +679,7 @@ parse_pwdhistory( struct berval *bv, char **oid, time_t *oldtime, struct berval
{ {
char *ptr; char *ptr;
struct berval nv, npw; struct berval nv, npw;
int i, j; ber_len_t i, j;
assert (bv && (bv->bv_len > 0) && (bv->bv_val) && oldtime && oldpw ); assert (bv && (bv->bv_len > 0) && (bv->bv_val) && oldtime && oldpw );