aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.cxx
diff options
context:
space:
mode:
authorZufu Liu <unknown>2022-07-04 09:58:26 +1000
committerZufu Liu <unknown>2022-07-04 09:58:26 +1000
commite85eee7838814ad178a841527199270e936efd72 (patch)
tree3bf5968349af41859448eb73fc562ec25574713e /src/Document.cxx
parent4c7b9d551b0304c4184fda8cb803c95a64742fbf (diff)
downloadscintilla-mirror-e85eee7838814ad178a841527199270e936efd72.tar.gz
Feature [feature-requests:#1442] Tighter checking of indices avoids handling
out-of-bounds in lower layer. Make expressions agree in ApplyStep for clarity.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r--src/Document.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 54d14cda3..8e80502e0 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -348,7 +348,7 @@ Sci::Line Document::MarkerNext(Sci::Line lineStart, int mask) const noexcept {
}
int Document::AddMark(Sci::Line line, int markerNum) {
- if (line >= 0 && line <= LinesTotal()) {
+ if (line >= 0 && line < LinesTotal()) {
const int prev = Markers()->AddMark(line, markerNum, LinesTotal());
const DocModification mh(ModificationFlags::ChangeMarker, LineStart(line), 0, 0, nullptr, line);
NotifyModified(mh);
@@ -359,7 +359,7 @@ int Document::AddMark(Sci::Line line, int markerNum) {
}
void Document::AddMarkSet(Sci::Line line, int valueSet) {
- if (line < 0 || line > LinesTotal()) {
+ if (line < 0 || line >= LinesTotal()) {
return;
}
unsigned int m = valueSet;