From c77101ce15d3d09ed7f257eea9c8bfa456a725c4 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 14 Jul 2015 00:54:15 +0200 Subject: curses: fixed arithmetic error when window is smaller than 2 columns --- src/interface-curses.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/interface-curses.cpp') diff --git a/src/interface-curses.cpp b/src/interface-curses.cpp index 7f5693c..47f26b8 100644 --- a/src/interface-curses.cpp +++ b/src/interface-curses.cpp @@ -867,7 +867,8 @@ InterfaceCurses::draw_cmdline(void) guint disp_len; disp_offset = cmdline_len - - MIN(cmdline_len, total_width/2 + cmdline_len % (total_width/2)); + MIN(cmdline_len, + total_width/2 + cmdline_len % MAX(total_width/2, 1)); /* * NOTE: we do not use getmaxx(cmdline_pad) here since it may be * larger than the text the pad contains. -- cgit v1.2.3