command/all: fix off-by-one bug in parameter count check
This commit is contained in:
parent
d0909adf6b
commit
938054bdb8
@ -409,15 +409,15 @@ command_process(Client &client, unsigned num, char *line) noexcept
|
||||
StaticVector<const char *, COMMAND_ARGV_MAX> argv;
|
||||
|
||||
while (true) {
|
||||
char *a = tokenizer.NextParam();
|
||||
if (a == nullptr)
|
||||
break;
|
||||
|
||||
if (argv.full()) {
|
||||
r.Error(ACK_ERROR_ARG, "Too many arguments");
|
||||
return CommandResult::ERROR;
|
||||
}
|
||||
|
||||
char *a = tokenizer.NextParam();
|
||||
if (a == nullptr)
|
||||
break;
|
||||
|
||||
argv.push_back(a);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user