/* $ModDesc: Provides support for the SETHOST command */
-Server *Srv;
+static Server *Srv;
class cmd_sethost : public command_t
{
cmd_sethost() : command_t("SETHOST",'o',1)
{
this->source = "m_sethost.so";
+ syntax = "<new-hostname>";
}
- 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] != '.'))