]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
cmd_userhost List 5 users in the reply even if the query (incorrectly) contains more...
authorAttila Molnar <attilamolnar@hush.com>
Wed, 4 Feb 2015 18:16:20 +0000 (19:16 +0100)
committerAttila Molnar <attilamolnar@hush.com>
Wed, 4 Feb 2015 18:16:20 +0000 (19:16 +0100)
src/commands/cmd_userhost.cpp

index 1065f9a359b7492764361504a5c1b102902f1fcf..79685388f64e6c27b3687479fdd3a1e5e48011f0 100644 (file)
@@ -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]);