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.
This commit is contained in:
Sadie Powell 2020-03-09 13:57:06 +00:00
parent bfefabfb0f
commit 0643ce085c

View File

@ -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;
}