From 3f64c36654b935e90121e507b8c6b60debda7081 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 5 Sep 2012 00:37:09 +0200 Subject: [PATCH] fix NCursesClient::show_menu with big menu entries --- src/ncurses.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ncurses.cc b/src/ncurses.cc index 02bbe8a9..b1e29891 100644 --- a/src/ncurses.cc +++ b/src/ncurses.cc @@ -223,7 +223,7 @@ void NCursesClient::show_menu(const memoryview& choices) int max_x,max_y; getmaxyx(stdscr, max_y, max_x); - int columns = max_x / (int)longest; + int columns = max_x / std::min(max_x, (int)longest); int lines = std::min(10, (int)ceilf((float)m_choices.size()/columns)); m_menu = new_menu(&m_items[0]);