]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chghost.cpp
Probably wont compile yet - purge_empty_channels refactor
[user/henk/code/inspircd.git] / src / modules / m_chghost.cpp
index 9d60d929cb04cc6395c68e123b0367ac31b36a30..8cfc515cd77032ca8b8739e216c4bd356d972396 100644 (file)
@@ -21,11 +21,11 @@ using namespace std;
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
+#include "helperfuncs.h"
 
 /* $ModDesc: Provides support for the CHGHOST command */
 
-Server *Srv;
-
+static Server *Srv;
 
 class cmd_chghost : public command_t
 {
@@ -37,6 +37,11 @@ class cmd_chghost : public command_t
         
         void Handle(char **parameters, int pcnt, userrec *user)
        {
+                if (strlen(parameters[1]) > 64)
+                {
+                        WriteServ(user->fd,"NOTICE %s :*** CHGHOST: Host too long",user->nick);
+                       return;
+                }
                for (unsigned int x = 0; x < strlen(parameters[1]); x++)
                {
                        if (((tolower(parameters[1][x]) < 'a') || (tolower(parameters[1][x]) > 'z')) && (parameters[1][x] != '.'))