diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-02-04 19:16:20 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-02-04 19:16:20 +0100 |
commit | 40bcbd81b6e32f8db9aecf6d2b76ad71b3978411 (patch) | |
tree | 556e8c4827b45d449a296b39070569cfcb3ea2c0 /src/commands | |
parent | f6ace5e8084e2ab23f6797ab9d77a41466ea4a78 (diff) |
cmd_userhost List 5 users in the reply even if the query (incorrectly) contains more than 5 nicks
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/cmd_userhost.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/commands/cmd_userhost.cpp b/src/commands/cmd_userhost.cpp index 1065f9a35..79685388f 100644 --- a/src/commands/cmd_userhost.cpp +++ b/src/commands/cmd_userhost.cpp @@ -30,7 +30,7 @@ class CommandUserhost : public Command public: /** Constructor for userhost. */ - CommandUserhost ( Module* parent) : Command(parent,"USERHOST", 1, 5) { + CommandUserhost ( Module* parent) : Command(parent,"USERHOST", 1) { syntax = "<nick> [<nick> ...]"; } /** Handle command. @@ -46,7 +46,10 @@ CmdResult CommandUserhost::Handle (const std::vector<std::string>& parameters, U { std::string retbuf = "302 " + user->nick + " :"; - for (unsigned int i = 0; i < parameters.size(); i++) + unsigned int max = parameters.size(); + if (max > 5) + max = 5; + for (unsigned int i = 0; i < max; i++) { User *u = ServerInstance->FindNickOnly(parameters[i]); |