diff options
Diffstat (limited to 'src/game-server/commandhandler.cpp')
-rw-r--r-- | src/game-server/commandhandler.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/game-server/commandhandler.cpp b/src/game-server/commandhandler.cpp index f0cbcf3b..189da538 100644 --- a/src/game-server/commandhandler.cpp +++ b/src/game-server/commandhandler.cpp @@ -186,7 +186,15 @@ static std::string getArgument(std::string &args) // Jumps to the next parameter, // after the ending double-quote and space, // and remove the two double-quotes before returning. - args = args.substr(pos + 2); + if (pos + 2 < args.size()) + { + args = args.substr(pos + 2); + } + else + { + // This was the last argument + args.clear(); + } argument = argument.substr(1, pos - 1); } else |