diff src/charset.c @ 28964:8973f2f00872 v8.2.5004

patch 8.2.5004: right shift on negative number does not work as documented Commit: https://github.com/vim/vim/commit/338bf58eba758585ffef3fdfdba7d48477aacb7c Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 22 20:16:32 2022 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 22 May 2022 21:30:02 +0200
parents 6cdf55afaae9
children 057c26b5c33a
line wrap: on
line diff
--- a/src/charset.c
+++ b/src/charset.c
@@ -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;