summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-09-08 16:07:07 +0200
committerBram Moolenaar <Bram@vim.org>2013-09-08 16:07:07 +0200
commit95235e64d8329b8c0fbd9311d98626afe86ad911 (patch)
treef6c9b24ce2ea44482eceebdba5fe54e104a3288e
parent0300e465aa9b034455f2c98d9996d5a3b04e9900 (diff)
updated for version 7.4.026v7.4.026
Problem: Clang warning for int shift overflow. Solution: Use unsigned and cast back to int. (Dominique Pelle)
-rw-r--r--src/misc2.c16
-rw-r--r--src/version.c2
2 files changed, 11 insertions, 7 deletions
diff --git a/src/misc2.c b/src/misc2.c
index 504cf0aed3..b8655e84aa 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -6496,13 +6496,15 @@ get3c(fd)
get4c(fd)
FILE *fd;
{
- int n;
-
- n = getc(fd);
- n = (n << 8) + getc(fd);
- n = (n << 8) + getc(fd);
- n = (n << 8) + getc(fd);
- return n;
+ /* Use unsigned rather than int otherwise result is undefined
+ * when left-shift sets the MSB. */
+ unsigned 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;
}
/*
diff --git a/src/version.c b/src/version.c
index ff4e3bb6fc..f875d013d7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 26,
+/**/
25,
/**/
24,