summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectMultiword.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandObjectMultiword.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectMultiword.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp
index 9e02d9eec32..ed118f769e1 100644
--- a/lldb/source/Commands/CommandObjectMultiword.cpp
+++ b/lldb/source/Commands/CommandObjectMultiword.cpp
@@ -290,13 +290,12 @@ CommandObjectMultiword::HandleCompletion
const char *
CommandObjectMultiword::GetRepeatCommand (Args &current_command_args, uint32_t index)
{
- if (current_command_args.GetArgumentCount() == 0)
- return NULL;
index++;
+ if (current_command_args.GetArgumentCount() <= index)
+ return NULL;
CommandObject *sub_command_object = GetSubcommandObject (current_command_args.GetArgumentAtIndex(index));
if (sub_command_object == NULL)
return NULL;
- else
return sub_command_object->GetRepeatCommand(current_command_args, index);
}
OpenPOWER on IntegriCloud