diff options
author | Neil <nyamatongwe@gmail.com> | 2017-04-07 17:08:55 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-04-07 17:08:55 +1000 |
commit | 32ae171da032fbdcfc94405877a49e1d3e3b0abb (patch) | |
tree | 9c600e385a9411989765939febb04a95f7d565f5 | |
parent | 2e3803c65ec0a44bfef80ef9ec1014637a6a3781 (diff) | |
download | scintilla-mirror-32ae171da032fbdcfc94405877a49e1d3e3b0abb.tar.gz |
Check index before checking value at index.
-rw-r--r-- | src/CellBuffer.cxx | 4 |
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; |