]> 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 42b1378e04e18be6c6e6524132ab0f37b26e2c20..8cfc515cd77032ca8b8739e216c4bd356d972396 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
  *                       E-mail:
  *                <brain@chatspike.net>
  *               <Craig@chatspike.net>
@@ -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] != '.'))