From: Hallvard Furuseth Date: Mon, 13 Oct 2008 08:09:52 +0000 (+0000) Subject: Warning cleanup: signed meets unsigned. ber_printf() returns -1 on X-Git-Tag: ACLCHECK_0~1263 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f40582fc7d5bc7b4f96f5c7a2ae94dc890bb3cc9;p=openldap Warning cleanup: signed meets unsigned. ber_printf() returns -1 on error, not LBER_ERROR. --- diff --git a/clients/tools/common.c b/clients/tools/common.c index 86434283d8..d468dd9969 100644 --- a/clients/tools/common.c +++ b/clients/tools/common.c @@ -625,7 +625,7 @@ tool_args( int argc, char **argv ) (unsigned char *)bv.bv_val, bv.bv_len ); - if ( retcode == -1 || retcode > bv.bv_len ) { + if ( retcode == -1 || (unsigned) retcode > bv.bv_len ) { fprintf( stderr, "Unable to parse value of general control %s\n", control ); usage(); @@ -1310,7 +1310,7 @@ tool_bind( LDAP *ld ) sctrlsp = sctrls; } - assert( nsctrls < sizeof(sctrls)/sizeof(sctrls[0]) ); + assert( nsctrls < (int) (sizeof(sctrls)/sizeof(sctrls[0])) ); if ( authmethod == LDAP_AUTH_SASL ) { #ifdef HAVE_CYRUS_SASL @@ -1523,7 +1523,7 @@ tool_server_controls( LDAP *ld, LDAPControl *extra_c, int count ) ber_init2( ber, NULL, LBER_USE_DER ); - if ( ber_printf( ber, "s", proxydn ) == LBER_ERROR ) { + if ( ber_printf( ber, "s", proxydn ) == -1 ) { exit( EXIT_FAILURE ); } diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 43d4b5ff0e..04bbc725b0 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -856,13 +856,13 @@ getNextPage: &sync_cookie ); } - if ( err == LBER_ERROR ) { + if ( err == -1 ) { ber_free( syncber, 1 ); fprintf( stderr, _("ldap sync control encoding error!\n") ); return EXIT_FAILURE; } - if ( ber_flatten( syncber, &syncbvalp ) == LBER_ERROR ) { + if ( ber_flatten( syncber, &syncbvalp ) == -1 ) { return EXIT_FAILURE; } @@ -1618,7 +1618,7 @@ static int print_result( tool_write_ldif( LDIF_PUT_TEXT, "text", line, - next ? next - line : strlen( line ) ); + next ? (size_t) (next - line) : strlen( line )); line = next ? next + 1 : NULL; }