Skip to content

Commit 93f027e

Browse files
author
Jackmcbarn
committed
Avoid future bugs with Attach
1 parent 883dea2 commit 93f027e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

2.0/m_antibear.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ModuleAntiBear : public Module
3131
#endif
3232
ServerInstance->Extensions.Register(&bearExt);
3333
Implementation eventlist[] = { I_OnUserRegister, I_OnPreCommand };
34-
ServerInstance->Modules->Attach(eventlist, this, 2);
34+
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
3535
}
3636

3737
virtual ~ModuleAntiBear()

2.0/m_antibottler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ModuleAntiBottler : public Module
2828
{
2929
#endif
3030
Implementation eventlist[] = { I_OnPreCommand };
31-
ServerInstance->Modules->Attach(eventlist, this, 1);
31+
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
3232
}
3333

3434
virtual ~ModuleAntiBottler()

2.0/m_invisible.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class ModuleInvisible : public Module
102102
I_OnBuildNeighborList, I_OnSendWhoLine, I_OnNamesListItem,
103103
I_OnRehash
104104
};
105-
ServerInstance->Modules->Attach(eventlist, this, 7);
105+
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
106106
OnRehash(NULL);
107107
}
108108

2.1/m_invisible.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class ModuleInvisible : public Module
100100
I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserJoin,
101101
I_OnBuildNeighborList, I_OnSendWhoLine, I_OnNamesListItem
102102
};
103-
ServerInstance->Modules->Attach(eventlist, this, 7);
103+
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
104104
}
105105

106106
void ReadConfig(ConfigReadStatus&)

0 commit comments

Comments
 (0)