mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
updated for version 7.4.026
Problem: Clang warning for int shift overflow. Solution: Use unsigned and cast back to int. (Dominique Pelle)
This commit is contained in:
14
src/misc2.c
14
src/misc2.c
@@ -6496,13 +6496,15 @@ get3c(fd)
|
||||
get4c(fd)
|
||||
FILE *fd;
|
||||
{
|
||||
int n;
|
||||
/* Use unsigned rather than int otherwise result is undefined
|
||||
* when left-shift sets the MSB. */
|
||||
unsigned n;
|
||||
|
||||
n = getc(fd);
|
||||
n = (n << 8) + getc(fd);
|
||||
n = (n << 8) + getc(fd);
|
||||
n = (n << 8) + getc(fd);
|
||||
return n;
|
||||
n = (unsigned)getc(fd);
|
||||
n = (n << 8) + (unsigned)getc(fd);
|
||||
n = (n << 8) + (unsigned)getc(fd);
|
||||
n = (n << 8) + (unsigned)getc(fd);
|
||||
return (int)n;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user