diff options
author | Dave Davenport <qball@gmpclient.org> | 2014-08-22 17:29:15 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2014-08-22 17:29:15 +0200 |
commit | b665e85e69de01b6a7008920be7069e358d8ca56 (patch) | |
tree | aadc32998630e9a017d843180b02a93b57384a72 /source/dmenu-dialog.c | |
parent | 86b7571e04b356651a1720788a8e0868905ba409 (diff) |
Fix compile warnings with CLANG.
* signed compare with unsigned.
Diffstat (limited to 'source/dmenu-dialog.c')
-rw-r--r-- | source/dmenu-dialog.c | 8 |
1 files changed, 6 insertions, 2 deletions
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; |