]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_connectban.cpp
Dynamically determine the size of the eventlist[] passed to Attach()
[user/henk/code/inspircd.git] / src / modules / m_connectban.cpp
index 01019004645b140a4d116bf21775662ab537b5f1..798f06fb6f5704af2743bc0f9c63f8033507d88d 100644 (file)
@@ -34,7 +34,7 @@ class ModuleConnectBan : public Module
        void init()
        {
                Implementation eventlist[] = { I_OnUserConnect, I_OnGarbageCollect, I_OnRehash };
-               ServerInstance->Modules->Attach(eventlist, this, 3);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
                OnRehash(NULL);
        }