From 40bcbd81b6e32f8db9aecf6d2b76ad71b3978411 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 4 Feb 2015 19:16:20 +0100 Subject: [PATCH] cmd_userhost List 5 users in the reply even if the query (incorrectly) contains more than 5 nicks --- src/commands/cmd_userhost.cpp | 7 +++++-- 1 file 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 = " [ ...]"; } /** Handle command. @@ -46,7 +46,10 @@ CmdResult CommandUserhost::Handle (const std::vector& 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]); -- 2.39.5