#include "inspircd.h"
-#include "mode.h"
-#include "channels.h"
-#include "users.h"
#include "builtinmodes.h"
ModeChannelLimit::ModeChannelLimit()
ModeAction ModeChannelLimit::OnSet(User* user, Channel* chan, std::string& parameter)
{
- ext.set(chan, ConvToInt(parameter));
+ int limit = ConvToInt(parameter);
+ if (limit < 0)
+ return MODEACTION_DENY;
+
+ ext.set(chan, limit);
return MODEACTION_ALLOW;
}