From 0d7ee548e16efda929ea6b3882a48d6d7a21c10f Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Fri, 17 Oct 2008 16:35:24 +0000 Subject: [PATCH] Warning cleanup: signed meets unsigned. (Adds variable dosearch():outlen.) --- clients/tools/ldapsearch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.39.5