summaryrefslogtreecommitdiff
path: root/src/modules
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/modules
parent60d92db9a1b71bbfd4230c5eb9f04cd6a87a41d8 (diff)
Convert Disabled[CU]Modes to use a bitset instead of a char array.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_conn_umodes.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/modules/m_conn_umodes.cpp b/src/modules/m_conn_umodes.cpp
index 0b708641e..acac7640a 100644
--- a/src/modules/m_conn_umodes.cpp
+++ b/src/modules/m_conn_umodes.cpp
@@ -39,10 +39,8 @@ class ModuleModesOnConnect : public Module
void OnUserConnect(LocalUser* user) CXX11_OVERRIDE
{
// Backup and zero out the disabled usermodes, so that we can override them here.
- char save[64];
- memcpy(save, ServerInstance->Config->DisabledUModes,
- sizeof(ServerInstance->Config->DisabledUModes));
- memset(ServerInstance->Config->DisabledUModes, 0, 64);
+ const std::bitset<64> save = ServerInstance->Config->DisabledUModes;
+ ServerInstance->Config->DisabledUModes.reset();
ConfigTag* tag = user->MyClass->config;
std::string ThisModes = tag->getString("modes");
@@ -61,7 +59,7 @@ class ModuleModesOnConnect : public Module
ServerInstance->Parser.CallHandler("MODE", modes, user);
}
- memcpy(ServerInstance->Config->DisabledUModes, save, 64);
+ ServerInstance->Config->DisabledUModes = save;
}
};