summaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-09-11 15:38:26 +0100
committerPeter Powell <petpow@saberuk.com>2017-09-18 14:09:01 +0100
commitca9a56b7ac0ec2139ade835144369455baa757bc (patch)
tree85c22f30061f313ccba6c179667075ab347cc34e /src/mode.cpp
parent60d92db9a1b71bbfd4230c5eb9f04cd6a87a41d8 (diff)
Convert Disabled[CU]Modes to use a bitset instead of a char array.
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index cd825d7a2..c4969d467 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -286,8 +286,8 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, Mode
if (IS_LOCAL(user) && !user->IsOper())
{
- char* disabled = (type == MODETYPE_CHANNEL) ? ServerInstance->Config->DisabledCModes : ServerInstance->Config->DisabledUModes;
- if (disabled[modechar - 'A'])
+ const std::bitset<64>& disabled = (type == MODETYPE_CHANNEL) ? ServerInstance->Config->DisabledCModes : ServerInstance->Config->DisabledUModes;
+ if (disabled.test(modechar - 'A'))
{
user->WriteNumeric(ERR_NOPRIVILEGES, InspIRCd::Format("Permission Denied - %s mode %c has been locked by the administrator",
type == MODETYPE_CHANNEL ? "channel" : "user", modechar));