getInt: changed the type of the temp variable res from int to long, for it to be able to store the values LONG_MIN and LONG_MAX
parent
9ca30e10de
commit
07ddf03655
|
@ -65,7 +65,7 @@ int CfgBase::getInt(const std::string& name, int def, XMLElement* elem)
|
|||
std::string str;
|
||||
try {
|
||||
str = _get(name, elem);
|
||||
int res = strtol(str.c_str(), NULL, 10);
|
||||
long res = strtol(str.c_str(), NULL, 10);
|
||||
if (res==LONG_MIN || res==LONG_MAX) {
|
||||
THROWEXCEPTION("failed to read integer %s in element %s in configuration (is it too large? or invalid?)", str.c_str(), name.c_str());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue