mirror of
https://github.com/ScintillaOrg/lexilla.git
synced 2025-05-08 10:45:09 +08:00
Coverity: protect against potential for negative indexing.
This commit is contained in:
parent
6d51ba20fe
commit
0c5d07e06b
@ -168,7 +168,8 @@ void LexerEDIFACT::Lex(Sci_PositionU startPos, Sci_Position length, int, IDocume
|
||||
{
|
||||
posCurrent = ForwardPastWhitespace(pAccess, posCurrent, posFinish);
|
||||
// Mark whitespace as default
|
||||
styler.ColourTo(posCurrent - 1, SCE_EDI_DEFAULT);
|
||||
if (posCurrent > 0)
|
||||
styler.ColourTo(posCurrent - 1, SCE_EDI_DEFAULT);
|
||||
if (posCurrent >= posFinish)
|
||||
break;
|
||||
|
||||
|
@ -1532,7 +1532,7 @@ void SCI_METHOD LexerRaku::Fold(Sci_PositionU startPos, Sci_Position length, int
|
||||
|
||||
// init char and style variables
|
||||
char chNext = styler[startPos];
|
||||
int stylePrev = styler.StyleAt(startPos - 1);
|
||||
int stylePrev = startPos > 0 ? styler.StyleAt(startPos - 1) : 0;
|
||||
int styleNext = styler.StyleAt(startPos);
|
||||
int styleNextStartLine = styler.StyleAt(lineStartNext);
|
||||
int visibleChars = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user