CmdResult Handle (const std::vector<std::string>& parameters, User *user)
{
- size_t len = 0;
- for (std::string::const_iterator x = parameters[0].begin(); x != parameters[0].end(); x++, len++)
+ if (parameters[0].length() > ServerInstance->Config->Limits.MaxHost)
+ {
+ user->WriteNotice("*** SETHOST: Host too long");
+ return CMD_FAILURE;
+ }
+
+ for (std::string::const_iterator x = parameters[0].begin(); x != parameters[0].end(); x++)
{
if (!hostmap[(const unsigned char)*x])
{
}
}
- if (len > ServerInstance->Config->Limits.MaxHost)
- {
- user->WriteNotice("*** SETHOST: Host too long");
- return CMD_FAILURE;
- }
-
if (user->ChangeDisplayedHost(parameters[0]))
{
ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SETHOST to change their displayed host to "+user->dhost);