forked from premiere/premiere-libtorrent
fixed off-by-one read error in xml-parser, and removed some unnecessary casts in the unit test
This commit is contained in:
parent
5a23d04143
commit
67b12dfb90
|
@ -65,7 +65,7 @@ namespace libtorrent
|
|||
char const* val_start = 0;
|
||||
int token;
|
||||
// look for tag start
|
||||
for(; *p != '<' && p != end; ++p);
|
||||
for(; p != end && *p != '<'; ++p);
|
||||
|
||||
if (p != start)
|
||||
{
|
||||
|
|
|
@ -1351,7 +1351,7 @@ int test_main()
|
|||
|
||||
parse_state xml_s;
|
||||
xml_s.reset("urn:schemas-upnp-org:service:WANIPConnection:1");
|
||||
xml_parse((char*)upnp_xml, (char*)upnp_xml + sizeof(upnp_xml)
|
||||
xml_parse(upnp_xml, upnp_xml + sizeof(upnp_xml)
|
||||
, boost::bind(&find_control_url, _1, _2, boost::ref(xml_s)));
|
||||
|
||||
std::cerr << "namespace " << xml_s.service_type << std::endl;
|
||||
|
@ -1363,7 +1363,7 @@ int test_main()
|
|||
TEST_CHECK(xml_s.model == "D-Link Router");
|
||||
|
||||
xml_s.reset("urn:schemas-upnp-org:service:WANPPPConnection:1");
|
||||
xml_parse((char*)upnp_xml2, (char*)upnp_xml2 + sizeof(upnp_xml2)
|
||||
xml_parse(upnp_xml2, upnp_xml2 + sizeof(upnp_xml2)
|
||||
, boost::bind(&find_control_url, _1, _2, boost::ref(xml_s)));
|
||||
|
||||
std::cerr << "namespace " << xml_s.service_type << std::endl;
|
||||
|
|
Loading…
Reference in New Issue