mirror of
https://github.com/supleed2/svd2cpp.git
synced 2024-12-22 13:45:50 +00:00
Fixed overflow in setDeviceInfoAttrib
This commit is contained in:
parent
19cd372ec0
commit
e5a651fede
|
@ -46,7 +46,7 @@ void XmlParser::setDeviceInfoAttrib(tinyxml2::XMLElement* deviceRoot, const char
|
|||
|
||||
void XmlParser::setDeviceInfoAttrib(tinyxml2::XMLElement* deviceRoot, const char* name, unsigned int &field) const{
|
||||
tinyxml2::XMLElement* deviceEntry = deviceRoot->FirstChildElement(name);
|
||||
field = deviceEntry ? (std::stol(deviceEntry->GetText()) ?: std::stol(deviceEntry->GetText(), 0, 16)) : 0;
|
||||
field = deviceEntry ? (std::stoul(deviceEntry->GetText()) ?: std::stoul(deviceEntry->GetText(), 0, 16)) : 0;
|
||||
}
|
||||
void XmlParser::setDeviceInfoAttrib(tinyxml2::XMLElement* deviceRoot, const char* name, EAccess &field) const{
|
||||
tinyxml2::XMLElement* deviceEntry = deviceRoot->FirstChildElement(name);
|
||||
|
|
Loading…
Reference in a new issue