summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZsolt Parragi <zsolt.parragi@cancellar.hu>2019-02-12 21:01:18 +0100
committerBrad King <brad.king@kitware.com>2019-02-13 10:22:59 -0500
commit76a5ac210050e0c1ccdce8ce89a0c77579e30187 (patch)
treed4aa8697e9f704b34cbf40854b9dd3ac5aeb1408
parent6f23321d405930241fa431cfda7650f2993f0c19 (diff)
downloadcmake-76a5ac210050e0c1ccdce8ce89a0c77579e30187.tar.gz
cmListFileLexer: Add missing include to avoid possible pointer truncation
The `cmsys/Enconding.h` include had a typo in its surrounding ifdef, possibly causing a missing function declaration (`cmsysEncoding_DupToWide`). As this is C code, this resulted in the code compiling, but with a truncated return value, possibly causing crashes.
-rw-r--r--Source/LexerParser/cmListFileLexer.c2
-rw-r--r--Source/LexerParser/cmListFileLexer.in.l2
2 files changed, 2 insertions, 2 deletions
diff --git a/Source/LexerParser/cmListFileLexer.c b/Source/LexerParser/cmListFileLexer.c
index c726415be8..15dcda04a0 100644
--- a/Source/LexerParser/cmListFileLexer.c
+++ b/Source/LexerParser/cmListFileLexer.c
@@ -766,7 +766,7 @@ Modify cmListFileLexer.c:
/* IWYU pragma: no_forward_declare yyguts_t */
-#ifdef WIN32
+#ifdef _WIN32
#include "cmsys/Encoding.h"
#endif
diff --git a/Source/LexerParser/cmListFileLexer.in.l b/Source/LexerParser/cmListFileLexer.in.l
index 6a6fb5f06f..fdf14d2d38 100644
--- a/Source/LexerParser/cmListFileLexer.in.l
+++ b/Source/LexerParser/cmListFileLexer.in.l
@@ -18,7 +18,7 @@ Modify cmListFileLexer.c:
/* IWYU pragma: no_forward_declare yyguts_t */
-#ifdef WIN32
+#ifdef _WIN32
#include "cmsys/Encoding.h"
#endif