From 32ae171da032fbdcfc94405877a49e1d3e3b0abb Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 7 Apr 2017 17:08:55 +1000 Subject: Check index before checking value at index. --- src/CellBuffer.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/CellBuffer.cxx') 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; -- cgit v1.2.3