]> git.sur5r.net Git - openldap/commitdiff
Warning cleanup: signed meets unsigned. (Adds variable dosearch():outlen.)
authorHallvard Furuseth <hallvard@openldap.org>
Fri, 17 Oct 2008 16:35:24 +0000 (16:35 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Fri, 17 Oct 2008 16:35:24 +0000 (16:35 +0000)
clients/tools/ldapsearch.c

index 04bbc725b04d2c2c609e22459489cc67068f2b77..7e69fa5992b174a4aa56ff8274137afd4df8e71c 100644 (file)
@@ -1146,14 +1146,15 @@ static int dosearch(
        int                     cancel_msgid = -1;
 
        if( filtpatt != NULL ) {
-               size_t max_fsize = strlen( filtpatt ) + strlen( value ) + 1;
+               size_t max_fsize = strlen( filtpatt ) + strlen( value ) + 1, outlen;
                filter = malloc( max_fsize );
                if( filter == NULL ) {
                        perror( "malloc" );
                        return EXIT_FAILURE;
                }
 
-               if( snprintf( filter, max_fsize, filtpatt, value ) >= max_fsize ) {
+               outlen = snprintf( filter, max_fsize, filtpatt, value );
+               if( outlen >= max_fsize ) {
                        fprintf( stderr, "Bad filter pattern: \"%s\"\n", filtpatt );
                        free( filter );
                        return EXIT_FAILURE;