diff options
| author | 2015-02-04 19:16:20 +0100 | |
|---|---|---|
| committer | 2015-02-04 19:16:20 +0100 | |
| commit | 40bcbd81b6e32f8db9aecf6d2b76ad71b3978411 (patch) | |
| tree | 556e8c4827b45d449a296b39070569cfcb3ea2c0 /src/commands/cmd_userhost.cpp | |
| parent | m_spanningtree Fix TreeRoot UserCount being possibly wrong if loaded after st... (diff) | |
cmd_userhost List 5 users in the reply even if the query (incorrectly) contains more than 5 nicks
Diffstat (limited to 'src/commands/cmd_userhost.cpp')
| -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]); |
