diff options
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 0a84c26762..38a080b1ef 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -4718,10 +4718,11 @@ static int get_string_tv(char_u **arg, typval_T *rettv, int evaluate) ++p; /* For "\u" store the number according to * 'encoding'. */ - if (c != 'X') + if (c != 'X') { name += utf_char2bytes(nr, name); - else + } else { *name++ = nr; + } } break; @@ -9477,8 +9478,9 @@ static void f_getchar(typval_T *argvars, typval_T *rettv, FunPtr fptr) temp[i++] = K_SPECIAL; temp[i++] = K_SECOND(n); temp[i++] = K_THIRD(n); - } else + } else { i += utf_char2bytes(n, temp + i); + } temp[i++] = NUL; rettv->v_type = VAR_STRING; rettv->vval.v_string = vim_strsave(temp); @@ -18344,8 +18346,7 @@ void set_vim_var_char(int c) { char buf[MB_MAXBYTES + 1]; - buf[utf_char2bytes(c, (char_u *) buf)] = NUL; - + buf[utf_char2bytes(c, (char_u *)buf)] = NUL; set_vim_var_string(VV_CHAR, buf, -1); } |