aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-12 17:19:21 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-12 17:56:23 -0400
commit7faf682525ab1274ed30f1a48336a89f53841136 (patch)
tree026a49e1695ac4d9e51f5ed5873c395aae75b898
parent97331cab675bee00337aed983e9a3e302e28a619 (diff)
downloadrneovim-7faf682525ab1274ed30f1a48336a89f53841136.tar.gz
rneovim-7faf682525ab1274ed30f1a48336a89f53841136.tar.bz2
rneovim-7faf682525ab1274ed30f1a48336a89f53841136.zip
vim-patch:8.0.1227: undefined left shift in readfile()
Problem: Undefined left shift in readfile(). (Brian 'geeknik' Carpenter) Solution: Add cast to unsigned. (Dominique Pelle, closes vim/vim#2253) https://github.com/vim/vim/commit/dc1c98129484e7879bc6dbf38e523beb730988b6
-rw-r--r--src/nvim/fileio.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 0858436db3..af02b7faf2 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -1380,15 +1380,15 @@ retry:
}
} else if (fio_flags & FIO_UCS4) {
if (fio_flags & FIO_ENDIAN_L) {
- u8c = (*--p << 24);
- u8c += (*--p << 16);
- u8c += (*--p << 8);
+ u8c = (unsigned)*--p << 24;
+ u8c += (unsigned)*--p << 16;
+ u8c += (unsigned)*--p << 8;
u8c += *--p;
} else { /* big endian */
u8c = *--p;
- u8c += (*--p << 8);
- u8c += (*--p << 16);
- u8c += (*--p << 24);
+ u8c += (unsigned)*--p << 8;
+ u8c += (unsigned)*--p << 16;
+ u8c += (unsigned)*--p << 24;
}
} else { /* UTF-8 */
if (*--p < 0x80)