]> git.sur5r.net Git - openldap/commitdiff
Warning cleanup: signed meets unsigned. ber_printf() returns -1 on
authorHallvard Furuseth <hallvard@openldap.org>
Mon, 13 Oct 2008 08:09:52 +0000 (08:09 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Mon, 13 Oct 2008 08:09:52 +0000 (08:09 +0000)
error, not LBER_ERROR.

clients/tools/common.c
clients/tools/ldapsearch.c

index 86434283d8f21c40907cd1047d4140c4845b454e..d468dd9969f743c66d392ec5ccdd0d9eed4bef97 100644 (file)
@@ -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 );
                }
 
index 43d4b5ff0e0adf10ccdb993cafdb281e81314568..04bbc725b04d2c2c609e22459489cc67068f2b77 100644 (file)
@@ -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;
                                        }