mirror of
https://github.com/neovim/neovim.git
synced 2025-10-18 15:51:50 +00:00
eval/decode: Fix vim_str2nr invocation
This commit is contained in:
@@ -470,10 +470,11 @@ json_decode_string_cycle_start:
|
|||||||
t++;
|
t++;
|
||||||
switch (*t) {
|
switch (*t) {
|
||||||
case 'u': {
|
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;
|
t += 4;
|
||||||
unsigned long ch;
|
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) {
|
if (ch == 0) {
|
||||||
hasnul = true;
|
hasnul = true;
|
||||||
}
|
}
|
||||||
@@ -622,7 +623,7 @@ json_decode_string_cycle_start:
|
|||||||
} else {
|
} else {
|
||||||
// Convert integer
|
// Convert integer
|
||||||
long nr;
|
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;
|
tv.vval.v_number = (varnumber_T) nr;
|
||||||
}
|
}
|
||||||
POP(tv, false);
|
POP(tv, false);
|
||||||
|
Reference in New Issue
Block a user