lua/executor: Fix crash when printing empty string (#7157)

This commit is contained in:
Nikolai Aleksandrovich Pavlov
2017-08-13 18:37:35 +03:00
committed by Justin M. Keyes
parent 1f9c139fd3
commit bf1b1ea6ee
2 changed files with 8 additions and 1 deletions

View File

@@ -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 *)"");
}
}