]> granicus.if.org Git - neomutt/commitdiff
fix checks in menu_search()
authorRichard Russon <rich@flatcap.org>
Sat, 21 Sep 2019 15:21:35 +0000 (16:21 +0100)
committerRichard Russon <rich@flatcap.org>
Sat, 21 Sep 2019 16:55:08 +0000 (17:55 +0100)
menu.c

diff --git a/menu.c b/menu.c
index 8e920f02548e8e4338fe7400b32ded7814404cd6..39ff50877d6aa0588db627f6b88d4cbc50b3b4f4 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -1165,8 +1165,7 @@ static int menu_search(struct Menu *menu, int op)
   int search_dir;
   regex_t re;
   char buf[128];
-  char *search_buf =
-      ((menu->type >= 0) && (menu->type < MENU_MAX)) ? SearchBuffers[menu->type] : NULL;
+  char *search_buf = ((menu->type < MENU_MAX)) ? SearchBuffers[menu->type] : NULL;
 
   if (!(search_buf && *search_buf) || ((op != OP_SEARCH_NEXT) && (op != OP_SEARCH_OPPOSITE)))
   {
@@ -1180,7 +1179,7 @@ static int menu_search(struct Menu *menu, int op)
     {
       return -1;
     }
-    if ((menu->type >= 0) && (menu->type < MENU_MAX))
+    if (menu->type < MENU_MAX)
     {
       mutt_str_replace(&SearchBuffers[menu->type], buf);
       search_buf = SearchBuffers[menu->type];