Mercurial > vim
diff src/screen.c @ 6466:b5df99582638 v7.4.562
updated for version 7.4.562
Problem: Segfault with wide screen and error in 'rulerformat'. (Ingo Karkat)
Solution: Check there is enough space. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 07 Jan 2015 13:31:52 +0100 |
parents | d2239abd3edb |
children | 0b245c8dbd19 |
line wrap: on
line diff
--- a/src/screen.c +++ b/src/screen.c @@ -10588,7 +10588,8 @@ win_redr_ruler(wp, always) this_ru_col = (WITH_WIDTH(width) + 1) / 2; if (this_ru_col + o < WITH_WIDTH(width)) { - while (this_ru_col + o < WITH_WIDTH(width)) + /* need at least 3 chars left for get_rel_pos() + NUL */ + while (this_ru_col + o < WITH_WIDTH(width) && RULER_BUF_LEN > i + 4) { #ifdef FEAT_MBYTE if (has_mbyte)