Fix crash when input settings contain extra channels

deque
scrawl 10 years ago
parent 7f95e1e6c2
commit 24e5a90bab

@ -84,7 +84,7 @@ namespace ICS
TiXmlElement* xmlChannel = xmlControl->FirstChildElement("Channel"); TiXmlElement* xmlChannel = xmlControl->FirstChildElement("Channel");
while(xmlChannel) while(xmlChannel)
{ {
controlChannelCount = std::max(channelCount, FromString<size_t>(xmlChannel->Attribute("number"))); controlChannelCount = std::max(channelCount, FromString<size_t>(xmlChannel->Attribute("number"))+1);
xmlChannel = xmlChannel->NextSiblingElement("Channel"); xmlChannel = xmlChannel->NextSiblingElement("Channel");
} }

Loading…
Cancel
Save