diff options
-rw-r--r-- | src/modules/m_chghost.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 8c3911418..0262a5f37 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -33,6 +33,12 @@ class CommandChghost : public Command { const char* x = parameters[1].c_str(); + if (parameters[1].length() > 63) + { + user->WriteServ("NOTICE %s :*** CHGHOST: Host too long", user->nick.c_str()); + return CMD_FAILURE; + } + for (; *x; x++) { if (!hostmap[(unsigned char)*x]) @@ -42,11 +48,6 @@ class CommandChghost : public Command } } - if ((parameters[1].c_str() - x) > 63) - { - user->WriteServ("NOTICE %s :*** CHGHOST: Host too long", user->nick.c_str()); - return CMD_FAILURE; - } User* dest = ServerInstance->FindNick(parameters[0]); if (!dest) |