Skip to content

Commit

Permalink
uHAL: Fix bug from few commits ago. See #146
Browse files Browse the repository at this point in the history
  • Loading branch information
tswilliams committed Jan 3, 2020
1 parent 189e3a1 commit d7092dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions uhal/tests/src/common/test_nodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ BOOST_FIXTURE_TEST_CASE (invalid_mask, SimpleAddressTableFixture)
lBadValues.push_back(" ");
lBadValues.push_back(" ");
lBadValues.push_back("-1");
lBadValues.push_back("42a");
lBadValues.push_back("-0x11");
lBadValues.push_back("0x");
lBadValues.push_back("x");
Expand Down Expand Up @@ -640,6 +641,7 @@ BOOST_FIXTURE_TEST_CASE (invalid_size, SimpleAddressTableFixture)
lBadValues.push_back(" ");
lBadValues.push_back(" ");
lBadValues.push_back("-1");
lBadValues.push_back("42a");
lBadValues.push_back("-0x11");
lBadValues.push_back("0x");
lBadValues.push_back("x");
Expand Down
2 changes: 1 addition & 1 deletion uhal/uhal/src/common/utilities/xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ namespace uhal
}
}

if ( lAttrStr.find_first_not_of("0123456789", lBasePrefixLength) != std::string::npos )
if ( lAttrStr.find_first_not_of(lBasePrefixLength ? "0123456789abcdefABCDEF" : "0123456789", lBasePrefixLength) != std::string::npos )
throw exception::NodeAttributeIncorrectValue("XML attribute '" + aAttrName + "' has value '" + lAttrStr + "' that cannot be converted to uint32_t");

ss << lAttrStr.substr(lBasePrefixLength);
Expand Down

0 comments on commit d7092dd

Please sign in to comment.