Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/engine/framework/ConsoleField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace Console {
Cmd::Args args(std::string(commandStart, commandEnd));
int argNum = args.Argc() - 1;
std::string prefix;
if (!args.Argc() || Str::cisspace(GetText()[GetCursorPos() - 1])) {
if (!args.Argc() || !GetCursorPos() || Str::cisspace(GetText()[GetCursorPos() - 1])) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way things initially go wrong is with the subtraction underflow in std::string commandText = Str::UTF32To8(GetText().substr(1, GetCursorPos() - 1));. Would be nicer to return before that

argNum++;
} else {
prefix = args.Argv(argNum);
Expand Down