1
0
forked from aniani/vim

patch 8.2.5004: right shift on negative number does not work as documented

Problem:    Right shift on negative number does not work as documented.
Solution:   Use a uvarnumber_T type cast.
This commit is contained in:
Bram Moolenaar
2022-05-22 20:16:32 +01:00
parent a061f34191
commit 338bf58eba
7 changed files with 26 additions and 19 deletions

View File

@@ -2002,6 +2002,7 @@ vim_str2nr(
}
else
{
// prevent a larg unsigned number to become negative
if (un > VARNUM_MAX)
un = VARNUM_MAX;
*nptr = (varnumber_T)un;