From 739b08770578b891cab4c824ca29eeb01445457f Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 31 Dec 2006 13:29:46 +0000 Subject: Fix broken LOLCODE git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6192 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_chghost.cpp | 11 +++++------ src/modules/m_sethost.cpp | 10 ++++------ 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index f3bc6b1ae..e0f69faba 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -26,9 +26,9 @@ class cmd_chghost : public command_t { private: - char*& hostmap; + char* hostmap; public: - cmd_chghost (InspIRCd* Instance, char* &hmap) : command_t(Instance,"CHGHOST",'o',2), hostmap(hmap) + cmd_chghost (InspIRCd* Instance, char* hmap) : command_t(Instance,"CHGHOST",'o',2), hostmap(hmap) { this->source = "m_chghost.so"; syntax = " "; @@ -70,12 +70,11 @@ class cmd_chghost : public command_t class ModuleChgHost : public Module { cmd_chghost* mycommand; - char* hostmap; + char hostmap[256]; public: ModuleChgHost(InspIRCd* Me) : Module::Module(Me) { - hostmap = new char[256]; OnRehash(""); mycommand = new cmd_chghost(ServerInstance, hostmap); ServerInstance->AddCommand(mycommand); @@ -92,9 +91,9 @@ class ModuleChgHost : public Module std::string hmap = Conf.ReadValue("hostname", "charmap", 0); if (hmap.empty()) - hostmap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789"; + hmap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789"; - memset(&hostmap, 0, sizeof(hostmap)); + memset(&hostmap, 0, 255); for (std::string::iterator n = hmap.begin(); n != hmap.end(); n++) hostmap[(unsigned char)*n] = 1; } diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index 0e116888c..048756b6d 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -26,9 +26,9 @@ class cmd_sethost : public command_t { private: - char*& hostmap; + char* hostmap; public: - cmd_sethost (InspIRCd* Instance, char*& hmap) : command_t(Instance,"SETHOST",'o',1), hostmap(hmap) + cmd_sethost (InspIRCd* Instance, char* hmap) : command_t(Instance,"SETHOST",'o',1), hostmap(hmap) { this->source = "m_sethost.so"; syntax = ""; @@ -64,12 +64,11 @@ class cmd_sethost : public command_t class ModuleSetHost : public Module { cmd_sethost* mycommand; - char* hostmap; + char hostmap[256]; public: ModuleSetHost(InspIRCd* Me) : Module::Module(Me) { - hostmap = new char[256]; OnRehash(""); mycommand = new cmd_sethost(ServerInstance, hostmap); ServerInstance->AddCommand(mycommand); @@ -88,14 +87,13 @@ class ModuleSetHost : public Module if (hmap.empty()) hmap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789"; - memset(&hostmap, 0, sizeof(hostmap)); + memset(&hostmap, 0, 255); for (std::string::iterator n = hmap.begin(); n != hmap.end(); n++) hostmap[(unsigned char)*n] = 1; } virtual ~ModuleSetHost() { - delete[] hostmap; } virtual Version GetVersion() -- cgit v1.2.3