aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/CellBuffer.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2017-04-07 17:08:55 +1000
committerNeil <nyamatongwe@gmail.com>2017-04-07 17:08:55 +1000
commit32ae171da032fbdcfc94405877a49e1d3e3b0abb (patch)
tree9c600e385a9411989765939febb04a95f7d565f5 /src/CellBuffer.cxx
parent2e3803c65ec0a44bfef80ef9ec1014637a6a3781 (diff)
downloadscintilla-mirror-32ae171da032fbdcfc94405877a49e1d3e3b0abb.tar.gz
Check index before checking value at index.
Diffstat (limited to 'src/CellBuffer.cxx')
-rw-r--r--src/CellBuffer.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index 1c4e920bf..290478c10 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -348,12 +348,12 @@ bool UndoHistory::CanRedo() const {
int UndoHistory::StartRedo() {
// Drop any leading startAction
- if (actions[currentAction].at == startAction && currentAction < maxAction)
+ if (currentAction < maxAction && actions[currentAction].at == startAction)
currentAction++;
// Count the steps in this action
int act = currentAction;
- while (actions[act].at != startAction && act < maxAction) {
+ while (act < maxAction && actions[act].at != startAction) {
act++;
}
return act - currentAction;