aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.c
diff options
context:
space:
mode:
authorNikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>2017-08-13 18:37:35 +0300
committerJustin M. Keyes <justinkz@gmail.com>2017-08-13 17:37:35 +0200
commitbf1b1ea6eebf254ed975b743241a598c6aeeb132 (patch)
tree27c7a15fa1cef1dcee60dd7785bc23dceaf43b7b /src/nvim/lua/executor.c
parent1f9c139fd3a060924daf8ce1df32fc3204c6231d (diff)
downloadrneovim-bf1b1ea6eebf254ed975b743241a598c6aeeb132.tar.gz
rneovim-bf1b1ea6eebf254ed975b743241a598c6aeeb132.tar.bz2
rneovim-bf1b1ea6eebf254ed975b743241a598c6aeeb132.zip
lua/executor: Fix crash when printing empty string (#7157)
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r--src/nvim/lua/executor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index 9ec5bfb8ad..eb821f7831 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -519,7 +519,7 @@ static int nlua_print(lua_State *const lstate)
}
msg((char_u *)str + start);
}
- if (str[len - 1] == NUL) { // Last was newline
+ if (len && str[len - 1] == NUL) { // Last was newline
msg((char_u *)"");
}
}