From: Hallvard Furuseth Date: Fri, 17 Oct 2008 16:35:24 +0000 (+0000) Subject: Warning cleanup: signed meets unsigned. (Adds variable dosearch():outlen.) X-Git-Tag: ACLCHECK_0~1240 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0d7ee548e16efda929ea6b3882a48d6d7a21c10f;p=openldap Warning cleanup: signed meets unsigned. (Adds variable dosearch():outlen.) --- diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 04bbc725b0..7e69fa5992 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -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;