From 9d14f4f39f9a6eb264e20edac861cca07e1a552e Mon Sep 17 00:00:00 2001 From: QC Date: Thu, 9 Jan 2014 22:16:48 +0100 Subject: [PATCH] Small fix initial view, allowing empty box to be selected. --- simpleswitcher.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simpleswitcher.c b/simpleswitcher.c index 7746ff85..bf5521ac 100644 --- a/simpleswitcher.c +++ b/simpleswitcher.c @@ -696,7 +696,7 @@ int menu(char **lines, char **input, char *prompt, int selected, Time *time) // filtered list char **filtered = allocate_clear(sizeof(char*) * max_lines); int *line_map = allocate_clear(sizeof(int) * max_lines); - int filtered_lines = max_lines; + int filtered_lines = 0; int jin = 0; for (i = 0; i < max_lines; i++) @@ -705,6 +705,7 @@ int menu(char **lines, char **input, char *prompt, int selected, Time *time) filtered[jin] = lines[i]; line_map[jin] = i; jin++; + filtered_lines++; } // resize window vertically to suit