aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r--src/nvim/buffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index fd55e8c7a0..b4b36f7fc0 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -3511,6 +3511,11 @@ build_stl_str_hl (
*/
void get_rel_pos(win_T *wp, char_u *buf, int buflen)
{
+ // Need at least 3 chars for writing.
+ if (buflen < 3) {
+ return;
+ }
+
long above; /* number of lines above window */
long below; /* number of lines below window */