mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-09 14:03:20 +09:00
Bug #1738: expr_bool.y returns -1 if the type does not match
This commit is contained in:
1 parent
591123265c
commit
4c27fd2fea
1 file changed
+14
@@ -230,6 +230,13 @@ int get_xml_attribute(ObjectXML * oxml, const char* attr, int& val)
|
||||
istringstream iss(results[0]);
|
||||
iss >> val;
|
||||
|
||||
if (iss.fail())
|
||||
{
|
||||
val = 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -276,6 +283,13 @@ int get_xml_attribute(ObjectXML * oxml, const char* attr, float& val)
|
||||
istringstream iss(results[0]);
|
||||
iss >> val;
|
||||
|
||||
if (iss.fail())
|
||||
{
|
||||
val = 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user