Mercurial > vim
diff src/normal.c @ 6559:22f164bd7e8e v7.4.606
updated for version 7.4.606
Problem: May crash when using a small window.
Solution: Avoid dividing by zero. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 27 Jan 2015 20:59:31 +0100 |
parents | 749fc929da45 |
children | 578c16fbab66 |
line wrap: on
line diff
--- a/src/normal.c +++ b/src/normal.c @@ -4457,6 +4457,8 @@ nv_screengo(oap, dir, dist) col_off2 = col_off1 - curwin_col_off2(); width1 = W_WIDTH(curwin) - col_off1; width2 = W_WIDTH(curwin) - col_off2; + if (width2 == 0) + width2 = 1; /* avoid divide by zero */ #ifdef FEAT_VERTSPLIT if (curwin->w_width != 0)