X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chghost.cpp;h=5189ec141e36816b9d3eb3b4283c196137236d8c;hb=45805210f8c9bbce6222c50863a1671f562ccfbb;hp=e927ca69ae0da8be7fa28292b45fbd994e54bc74;hpb=e3bd782207f50d131acd008b0cbcc7545aac7690;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index e927ca69a..5189ec141 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -28,7 +28,7 @@ class CommandChghost : public Command syntax = " "; TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } - + CmdResult Handle(const std::vector ¶meters, User *user) { const char * x = parameters[1].c_str(); @@ -46,7 +46,7 @@ class CommandChghost : public Command user->WriteServ("NOTICE %s :*** CHGHOST: Host must be specified", user->nick.c_str()); return CMD_FAILURE; } - + if ((parameters[1].c_str() - x) > 63) { user->WriteServ("NOTICE %s :*** CHGHOST: Host too long", user->nick.c_str()); @@ -56,7 +56,7 @@ class CommandChghost : public Command if (!dest) { - user->WriteNumeric(401, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str()); + user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } @@ -94,7 +94,7 @@ class ModuleChgHost : public Module ServerInstance->Modules->Attach(eventlist, this, 1); } - + void OnRehash(User* user, const std::string ¶meter) { ConfigReader Conf(ServerInstance); @@ -103,7 +103,7 @@ class ModuleChgHost : public Module if (hmap.empty()) hmap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789"; - memset(&hostmap, 0, 255); + memset(hostmap, 0, sizeof(hostmap)); for (std::string::iterator n = hmap.begin(); n != hmap.end(); n++) hostmap[(unsigned char)*n] = 1; } @@ -111,12 +111,12 @@ class ModuleChgHost : public Module ~ModuleChgHost() { } - + Version GetVersion() { - return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); + return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); } - + }; MODULE_INIT(ModuleChgHost)