diff options
author | Neil <nyamatongwe@gmail.com> | 2015-12-07 11:08:40 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2015-12-07 11:08:40 +1100 |
commit | 18f8f63fb079b084323def219126836f23f5c2b4 (patch) | |
tree | 36a54cbfbc6a72621399e2cbc6923e1f11cc545a /src/EditView.cxx | |
parent | 7b5476dae723cc94adeae1460c068aa686f4583b (diff) | |
download | scintilla-mirror-18f8f63fb079b084323def219126836f23f5c2b4.tar.gz |
Prefer StyleIndexAt over StyleAt to avoid problems with out-of-bounds access for
styles > 0x7f.
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r-- | src/EditView.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index db6b34fe0..fc98c3d6d 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -376,14 +376,14 @@ void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, co // See if chars, styles, indicators, are all the same bool allSame = true; // Check base line layout - char styleByte = 0; + int styleByte = 0; int numCharsInLine = 0; while (numCharsInLine < lineLength) { int charInDoc = numCharsInLine + posLineStart; char chDoc = model.pdoc->CharAt(charInDoc); - styleByte = model.pdoc->StyleAt(charInDoc); + styleByte = model.pdoc->StyleIndexAt(charInDoc); allSame = allSame && - (ll->styles[numCharsInLine] == static_cast<unsigned char>(styleByte)); + (ll->styles[numCharsInLine] == styleByte); if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseMixed) allSame = allSame && (ll->chars[numCharsInLine] == chDoc); |