diff options
author | Sadie Powell <sadie@witchery.services> | 2020-03-09 13:57:06 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-03-09 13:57:06 +0000 |
commit | 0643ce085c6a946fa52f2aa603f9f68d7a33a778 (patch) | |
tree | 059a6ffe4feb331c9135c102187decc761a37f65 | |
parent | bfefabfb0f2636445e7dfb91e14bf80d079e44e4 (diff) |
Fix not assigning bits to capabilities correctly.
This makes it correctly throw when the capability limit is reached
and allows up to 64 capabilities to be created instead of 32.
-rw-r--r-- | src/modules/m_cap.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index 3e07a86e7..b91e9ead2 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -78,9 +78,9 @@ class Cap::ManagerImpl : public Cap::Manager, public ReloadModule::EventListener used |= cap->GetMask(); } - for (unsigned int i = 0; i < MAX_CAPS; i++) + for (size_t i = 0; i < MAX_CAPS; i++) { - Capability::Bit bit = (1 << i); + Capability::Bit bit = (static_cast<Capability::Bit>(1) << i); if (!(used & bit)) return bit; } |