diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-10 09:42:07 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-11 14:32:59 -0400 |
commit | f7f65f5a82346a18c3ddf7143d64e8ce3ad399e2 (patch) | |
tree | 8c65d6ef502069d0be9238e22e4b124d5a8f0112 /src/nvim/regexp.c | |
parent | dd6c1a0a8f14aed30816aae6a354f2056bfbf15f (diff) | |
download | rneovim-f7f65f5a82346a18c3ddf7143d64e8ce3ad399e2.tar.gz rneovim-f7f65f5a82346a18c3ddf7143d64e8ce3ad399e2.tar.bz2 rneovim-f7f65f5a82346a18c3ddf7143d64e8ce3ad399e2.zip |
vim-patch:8.0.1254: undefined left shift in gethexchrs()
Problem: Undefined left shift in gethexchrs(). (geeknik)
Solution: Use unsigned long. (idea by Christian Brabandt, closes vim/vim#2255)
https://github.com/vim/vim/commit/4c22a91d20cce4f28dd2852a13129b5a4cc691da
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r-- | src/nvim/regexp.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index be6c43493b..9bfc158763 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -1664,9 +1664,8 @@ static char_u *regpiece(int *flagp) case Magic('@'): { int lop = END; - int nr; + int64_t nr = getdecchrs(); - nr = getdecchrs(); switch (no_Magic(getchr())) { case '=': lop = MATCH; break; /* \@= */ case '!': lop = NOMATCH; break; /* \@! */ @@ -2087,7 +2086,7 @@ static char_u *regatom(int *flagp) case 'u': /* %uabcd hex 4 */ case 'U': /* %U1234abcd hex 8 */ { - int i; + int64_t i; switch (c) { case 'd': i = getdecchrs(); break; @@ -2976,9 +2975,9 @@ static void ungetchr(void) * The parameter controls the maximum number of input characters. This will be * 2 when reading a \%x20 sequence and 4 when reading a \%u20AC sequence. */ -static int gethexchrs(int maxinputlen) +static int64_t gethexchrs(int maxinputlen) { - int nr = 0; + int64_t nr = 0; int c; int i; @@ -3000,9 +2999,9 @@ static int gethexchrs(int maxinputlen) * Get and return the value of the decimal string immediately after the * current position. Return -1 for invalid. Consumes all digits. */ -static int getdecchrs(void) +static int64_t getdecchrs(void) { - int nr = 0; + int64_t nr = 0; int c; int i; @@ -3029,9 +3028,9 @@ static int getdecchrs(void) * blahblah\%o210asdf * before-^ ^-after */ -static int getoctchrs(void) +static int64_t getoctchrs(void) { - int nr = 0; + int64_t nr = 0; int c; int i; @@ -3055,7 +3054,7 @@ static int getoctchrs(void) */ static int coll_get_char(void) { - int nr = -1; + int64_t nr = -1; switch (*regparse++) { case 'd': nr = getdecchrs(); break; |