mirror of
https://github.com/neovim/neovim.git
synced 2024-12-26 14:11:15 -07:00
eval/decode: Fix vim_str2nr invocation
This commit is contained in:
parent
33778c36cc
commit
f4ea114c67
@ -470,10 +470,11 @@ json_decode_string_cycle_start:
|
||||
t++;
|
||||
switch (*t) {
|
||||
case 'u': {
|
||||
const char ubuf[] = { t[1], t[2], t[3], t[4], 0 };
|
||||
const char ubuf[] = { t[1], t[2], t[3], t[4] };
|
||||
t += 4;
|
||||
unsigned long ch;
|
||||
vim_str2nr((char_u *) ubuf, NULL, NULL, 0, 0, 2, NULL, &ch);
|
||||
vim_str2nr((char_u *) ubuf, NULL, NULL,
|
||||
STR2NR_HEX | STR2NR_FORCE, NULL, &ch, 4);
|
||||
if (ch == 0) {
|
||||
hasnul = true;
|
||||
}
|
||||
@ -622,7 +623,7 @@ json_decode_string_cycle_start:
|
||||
} else {
|
||||
// Convert integer
|
||||
long nr;
|
||||
vim_str2nr((char_u *) s, NULL, NULL, 0, 0, 0, &nr, NULL);
|
||||
vim_str2nr((char_u *) s, NULL, NULL, 0, &nr, NULL, (int) (p - s));
|
||||
tv.vval.v_number = (varnumber_T) nr;
|
||||
}
|
||||
POP(tv, false);
|
||||
|
Loading…
Reference in New Issue
Block a user