0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.0.1380: CTRL-X on 2**64 subtracts two

Problem:    CTRL-X on 2**64 subtracts two. (James McCoy)
Solution:   Correct computation for large number. (closes #12103)
This commit is contained in:
Bram Moolenaar
2023-03-04 20:47:39 +00:00
parent 5284b23e14
commit 5fb78c3fa5
12 changed files with 69 additions and 21 deletions

View File

@@ -540,7 +540,7 @@ json_decode_string(js_read_T *reader, typval_T *res, int quote)
nr = 0;
len = 0;
vim_str2nr(p + 2, NULL, &len,
STR2NR_HEX + STR2NR_FORCE, &nr, NULL, 4, TRUE);
STR2NR_HEX + STR2NR_FORCE, &nr, NULL, 4, TRUE, NULL);
if (len == 0)
{
if (res != NULL)
@@ -556,8 +556,8 @@ json_decode_string(js_read_T *reader, typval_T *res, int quote)
// decode surrogate pair: \ud812\u3456
len = 0;
vim_str2nr(p + 2, NULL, &len,
STR2NR_HEX + STR2NR_FORCE, &nr2, NULL, 4, TRUE);
vim_str2nr(p + 2, NULL, &len, STR2NR_HEX + STR2NR_FORCE,
&nr2, NULL, 4, TRUE, NULL);
if (len == 0)
{
if (res != NULL)
@@ -882,7 +882,7 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
vim_str2nr(reader->js_buf + reader->js_used,
NULL, &len, 0, // what
&nr, NULL, 0, TRUE);
&nr, NULL, 0, TRUE, NULL);
if (len == 0)
{
semsg(_(e_json_decode_error_at_str), p);