From b665e85e69de01b6a7008920be7069e358d8ca56 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Fri, 22 Aug 2014 17:29:15 +0200 Subject: Fix compile warnings with CLANG. * signed compare with unsigned. --- source/dmenu-dialog.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/dmenu-dialog.c') diff --git a/source/dmenu-dialog.c b/source/dmenu-dialog.c index b18de68e..a1bbd928 100644 --- a/source/dmenu-dialog.c +++ b/source/dmenu-dialog.c @@ -37,7 +37,7 @@ char *dmenu_prompt = "dmenu "; -static char **get_dmenu ( unsigned int *length ) +static char **get_dmenu ( int *length ) { char buffer[1024]; char **retv = NULL; @@ -55,6 +55,10 @@ static char **get_dmenu ( unsigned int *length ) } ( *length )++; + // Stop when we hit 2³¹ entries. + if( (*length) == INT_MAX) { + return retv; + } } return retv; @@ -64,7 +68,7 @@ int dmenu_switcher_dialog ( char **input ) { int selected_line = 0; int retv = FALSE; - unsigned int length = 0; + int length = 0; char **list = get_dmenu ( &length ); int restart = FALSE; -- cgit v1.2.3