Skip to content

Commit

Permalink
Return data.size() when not confident
Browse files Browse the repository at this point in the history
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
  • Loading branch information
sloretz committed Aug 25, 2020
1 parent 69b3d49 commit 025f816
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions urdf/src/urdf_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <urdf_parser/urdf_parser.h>
#include <urdf_parser_plugin/parser.h>

#include <limits>
#include <string>

namespace urdf
Expand Down Expand Up @@ -66,7 +65,7 @@ size_t URDFXMLParser::might_handle(const std::string & data)
// Since it's an XML document it must have `<robot>` as the first tag
const tinyxml2::XMLElement * root = doc.RootElement();
if (std::string("robot") != root->Name()) {
return std::numeric_limits<size_t>::max();
return data.size();
}
}

Expand Down

0 comments on commit 025f816

Please sign in to comment.