summaryrefslogtreecommitdiff
path: root/src/normal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-01-27 20:59:31 +0100
committerBram Moolenaar <Bram@vim.org>2015-01-27 20:59:31 +0100
commit7cc8ec47208f784418e40d1ede49c4aeb95b0b53 (patch)
tree9015cfc2d8dd31630cf5de259c0423f3a98ca161 /src/normal.c
parent3b3a9498d1eab3c28c524cce115160528a9a9297 (diff)
downloadvim-git-7cc8ec47208f784418e40d1ede49c4aeb95b0b53.tar.gz
updated for version 7.4.606v7.4.606
Problem: May crash when using a small window. Solution: Avoid dividing by zero. (Christian Brabandt)
Diffstat (limited to 'src/normal.c')
-rw-r--r--src/normal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/normal.c b/src/normal.c
index cb1a7d154..74a001e82 100644
--- 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)