aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lexers/LexCPP.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index b8b48aa52..b7ff1859b 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -1211,7 +1211,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
while ((endName < restOfLine.length()) && setWord.Contains(static_cast<unsigned char>(restOfLine[endName])))
endName++;
std::string key = restOfLine.substr(startName, endName-startName);
- if (restOfLine[endName] == '(') {
+ if ((endName < restOfLine.length()) && (restOfLine.at(endName) == '(')) {
// Macro
size_t endArgs = endName;
while ((endArgs < restOfLine.length()) && (restOfLine[endArgs] != ')'))