aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditView.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2015-12-07 11:08:40 +1100
committerNeil <nyamatongwe@gmail.com>2015-12-07 11:08:40 +1100
commit3c85e3a83b0d2f7da09b7b2573cb799842285ca7 (patch)
tree8256524808bc7f6d5cbe3601eb24cb4854da3c44 /src/EditView.cxx
parentbd5ac521d9b3d1330d2e1906dc96012b40a016da (diff)
downloadscintilla-mirror-3c85e3a83b0d2f7da09b7b2573cb799842285ca7.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.cxx6
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);