]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_channelban.cpp
Merge pull request #1169 from SaberUK/insp20+fix-makefile
[user/henk/code/inspircd.git] / src / modules / m_channelban.cpp
index 655ed82cd9e1c5a842685de0e1bf5f2e274e7024..6eec486ea8a1a4cab6149d6e4651f5f3115b3859 100644 (file)
@@ -26,9 +26,10 @@ class ModuleBadChannelExtban : public Module
 {
  private:
  public:
-       ModuleBadChannelExtban()        {
+       void init()
+       {
                Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric };
-               ServerInstance->Modules->Attach(eventlist, this, 2);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        ~ModuleBadChannelExtban()
@@ -42,7 +43,7 @@ class ModuleBadChannelExtban : public Module
 
        ModResult OnCheckBan(User *user, Channel *c, const std::string& mask)
        {
-               if (mask[0] == 'j' && mask[1] == ':')
+               if ((mask.length() > 2) && (mask[0] == 'j') && (mask[1] == ':'))
                {
                        std::string rm = mask.substr(2);
                        char status = 0;