aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Document.cxx4
-rw-r--r--src/Partitioning.h4
2 files changed, 4 insertions, 4 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;
diff --git a/src/Partitioning.h b/src/Partitioning.h
index efa6bf95e..0fffd119a 100644
--- a/src/Partitioning.h
+++ b/src/Partitioning.h
@@ -70,7 +70,7 @@ private:
body->RangeAddDelta(stepPartition+1, partitionUpTo + 1, stepLength);
}
stepPartition = partitionUpTo;
- if (stepPartition >= body->Length()-1) {
+ if (stepPartition >= Partitions()) {
stepPartition = Partitions();
stepLength = 0;
}
@@ -149,7 +149,7 @@ public:
void SetPartitionStartPosition(T partition, T pos) noexcept {
ApplyStep(partition+1);
- if ((partition < 0) || (partition > body->Length())) {
+ if ((partition < 0) || (partition >= body->Length())) {
return;
}
body->SetValueAt(partition, pos);