Fixed #6201: event handler count check

This commit is contained in:
Armin Novak 2020-05-19 19:25:18 +02:00 committed by akallabeth
parent 6c151ee15c
commit 50278f7076

View File

@ -112,15 +112,10 @@ int PubSub_Subscribe(wPubSub* pubSub, const char* EventName, pEventHandler Event
{
status = 0;
if (event->EventHandlerCount <= MAX_EVENT_HANDLERS)
{
event->EventHandlers[event->EventHandlerCount] = EventHandler;
event->EventHandlerCount++;
}
if (event->EventHandlerCount < MAX_EVENT_HANDLERS)
event->EventHandlers[event->EventHandlerCount++] = EventHandler;
else
{
status = -1;
}
}
if (pubSub->synchronized)