diff --git a/ChangeLog b/ChangeLog index 9b68f4cbd5b28c50148e37d719d0e5e874c42d7e..f64e2941f2469afea3305b3aca9239780f62f3d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-05-31 Mahyar Abbaspour <mahyar.abaspour@gmail.com> + * src/prompt.c (get_statusbar_page_start): Prevent a floating-point + exception when the available length for an answer becomes zero. + 2015-05-28 Benno Schulenberg <bensberg@justemail.net> * src/help.c (do_help), src/prompt.c (do_yesno_prompt): Normalize the whitespace after the recent changes in logic. diff --git a/src/prompt.c b/src/prompt.c index 671d53acf75ca192770567202c0dc3e7c5725757..61c4347f491730bd6af9435837d5248e7305cbf7 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -650,7 +650,7 @@ size_t statusbar_xplustabs(void) * get_statusbar_page_start(column) < COLS). */ size_t get_statusbar_page_start(size_t start_col, size_t column) { - if (column == start_col || column < COLS - 1) + if (column == start_col || column < COLS - 1 || COLS == start_col + 1) return 0; else return column - start_col - (column - start_col) % (COLS -