Communication: Fix loopLimit when parsing SupportedFeaturesPacket

pull/56/head
Jonathan Schwartz 2023-05-10 23:18:04 +00:00
parent f5096b879c
commit 1e773ba9ab
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ std::shared_ptr<SupportedFeaturesMessage> SupportedFeaturesPacket::DecodeToMessa
if(bytes.size() < expectedSize) { if(bytes.size() < expectedSize) {
return msg; // Empty return msg; // Empty
} }
unsigned int loopLimit = std::min<unsigned int>(response.numValidBits, NumSupportedFeaturesFields); unsigned int loopLimit = std::min<unsigned int>(response.numValidBits, static_cast<unsigned int>(SupportedFeature::numSupportedFeatures));
for(unsigned int i = 0; i < loopLimit; ++i) { for(unsigned int i = 0; i < loopLimit; ++i) {
uint32_t wordOffset = i / 32; uint32_t wordOffset = i / 32;
uint32_t bitOffset = i % 32; uint32_t bitOffset = i % 32;