0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -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

@@ -1188,7 +1188,7 @@ f_str2nr(typval_T *argvars, typval_T *rettv)
case 8: what |= STR2NR_OCT + STR2NR_OOCT + STR2NR_FORCE; break;
case 16: what |= STR2NR_HEX + STR2NR_FORCE; break;
}
vim_str2nr(p, NULL, NULL, what, &n, NULL, 0, FALSE);
vim_str2nr(p, NULL, NULL, what, &n, NULL, 0, FALSE, NULL);
// Text after the number is silently ignored.
if (isneg)
rettv->vval.v_number = -n;