diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-07-14 00:54:15 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-07-14 00:54:15 +0200 |
commit | c77101ce15d3d09ed7f257eea9c8bfa456a725c4 (patch) | |
tree | 981c474891077e8d18d69f17e205bef9cb60c585 /src | |
parent | 6a9a7d56643c496ec9da643e19c254c5a3b397ed (diff) | |
download | sciteco-c77101ce15d3d09ed7f257eea9c8bfa456a725c4.tar.gz |
curses: fixed arithmetic error when window is smaller than 2 columns
Diffstat (limited to 'src')
-rw-r--r-- | src/interface-curses.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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. |