]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sethost.cpp
Updates, should be able to safely unload client modules with queries in progress...
[user/henk/code/inspircd.git] / src / modules / m_sethost.cpp
index 0894e8f24c3588c2aaab5e8090a6127524281335..eb2196c92d7f7966d4ec6433bbb337491d23a171 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>
@@ -25,7 +25,7 @@ using namespace std;
 
 /* $ModDesc: Provides support for the SETHOST command */
 
-Server *Srv;
+static Server *Srv;
 
 class cmd_sethost : public command_t
 {
@@ -35,8 +35,13 @@ class cmd_sethost : public command_t
                this->source = "m_sethost.so";
        }
 
-       void Handle (char **parameters, int pcnt, userrec *user)
+       void Handle (const char** parameters, int pcnt, userrec *user)
        {
+               if (strlen(parameters[0]) > 64)
+               {
+                       WriteServ(user->fd,"NOTICE %s :*** SETHOST: Host too long",user->nick);
+                       return;
+               }
                for (unsigned int x = 0; x < strlen(parameters[0]); x++)
                {
                        if (((tolower(parameters[0][x]) < 'a') || (tolower(parameters[0][x]) > 'z')) && (parameters[0][x] != '.'))