aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <nyamatongwe@gmail.com>2012-07-29 15:51:18 +1000
committernyamatongwe <nyamatongwe@gmail.com>2012-07-29 15:51:18 +1000
commit0254ac70263755cb2f92911451ec6bbebe34452f (patch)
tree608b2db825539fb535e6a419e90da4309c339731
parent256a6d311049a907a134958ea4a8435c6fd9842f (diff)
downloadscintilla-mirror-0254ac70263755cb2f92911451ec6bbebe34452f.tar.gz
Extra checks to stop Clang analyze warnings.
-rw-r--r--lexers/LexOthers.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/lexers/LexOthers.cxx b/lexers/LexOthers.cxx
index 259059fd9..ee5521bac 100644
--- a/lexers/LexOthers.cxx
+++ b/lexers/LexOthers.cxx
@@ -857,17 +857,19 @@ static void ColouriseMakeLine(
while ((i < lengthLine) && isspacechar(lineBuffer[i])) {
i++;
}
- if (lineBuffer[i] == '#') { // Comment
- styler.ColourTo(endPos, SCE_MAKE_COMMENT);
- return;
- }
- if (lineBuffer[i] == '!') { // Special directive
- styler.ColourTo(endPos, SCE_MAKE_PREPROCESSOR);
- return;
+ if (i < lengthLine) {
+ if (lineBuffer[i] == '#') { // Comment
+ styler.ColourTo(endPos, SCE_MAKE_COMMENT);
+ return;
+ }
+ if (lineBuffer[i] == '!') { // Special directive
+ styler.ColourTo(endPos, SCE_MAKE_PREPROCESSOR);
+ return;
+ }
}
int varCount = 0;
while (i < lengthLine) {
- if (lineBuffer[i] == '$' && lineBuffer[i + 1] == '(') {
+ if (((i + 1) < lengthLine) && (lineBuffer[i] == '$' && lineBuffer[i + 1] == '(')) {
styler.ColourTo(startLine + i - 1, state);
state = SCE_MAKE_IDENTIFIER;
varCount++;