Commit 40bfc729 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Preventing a floating-point exception when the available length

for an answer becomes zero.  The answer will instead wrap to the
next line, which does not look nice but is better than crashing.
Patch by Mahyar Abbaspour.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5235 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 5 additions and 1 deletion
+5 -1
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.
......
......@@ -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 -
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment