]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_commonchans.cpp
Dynamically determine the size of the eventlist[] passed to Attach()
[user/henk/code/inspircd.git] / src / modules / m_commonchans.cpp
index d91ab1231237cf56011ba2a71335cab44cf4831e..d5e7d4b1c6f693452c4f15adcd780071eb54d669 100644 (file)
@@ -42,7 +42,7 @@ class ModulePrivacyMode : public Module
                if (!ServerInstance->Modes->AddMode(&pm))
                        throw ModuleException("Could not add new modes!");
                Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice };
-               ServerInstance->Modules->Attach(eventlist, this, 2);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        virtual ~ModulePrivacyMode()