From: Andrew Borodin Date: Wed, 23 Jan 2013 07:13:24 +0000 (+0400) Subject: (insert_spaces_tab): fix floating point exception. X-Git-Tag: 4.8.8~28^2 X-Git-Url: https://repo.or.cz/w/midnight-commander.git/commitdiff_plain/f7cbaca9252df5d7530685712e11254129f8fe6f (insert_spaces_tab): fix floating point exception. Signed-off-by: Andrew Borodin --- diff --git a/src/editor/edit.c b/src/editor/edit.c index a9f685f99..b2ef4950f 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -1509,11 +1509,14 @@ insert_spaces_tab (WEdit * edit, gboolean half) i = option_tab_spacing * space_width; if (half) i /= 2; - i = ((edit->curs_col / i) + 1) * i - edit->curs_col; - while (i > 0) + if (i != 0) { - edit_insert (edit, ' '); - i -= space_width; + i = ((edit->curs_col / i) + 1) * i - edit->curs_col; + while (i > 0) + { + edit_insert (edit, ' '); + i -= space_width; + } } }