0
0
mirror of https://github.com/vim/vim.git synced 2025-10-12 06:44:06 -04:00

patch 8.2.1611: Vim9: cannot pass "true" to nr2char()

Problem:    Vim9: cannot pass "true" to nr2char().
Solution:   use tv_get_bool_chk(). (closes #6878)
This commit is contained in:
Bram Moolenaar
2020-09-05 20:29:41 +02:00
parent a48f786787
commit ed6a430fae
3 changed files with 7 additions and 1 deletions

View File

@@ -5874,7 +5874,7 @@ f_nr2char(typval_T *argvars, typval_T *rettv)
int utf8 = 0;
if (argvars[1].v_type != VAR_UNKNOWN)
utf8 = (int)tv_get_number_chk(&argvars[1], NULL);
utf8 = (int)tv_get_bool_chk(&argvars[1], NULL);
if (utf8)
buf[utf_char2bytes((int)tv_get_number(&argvars[0]), buf)] = NUL;
else