mirror of https://github.com/AxioDL/tinyxml2.git
Add and make use of pre- and post-asserts in XMLDocument::Identify()
This commit is contained in:
parent
1354ffabb6
commit
023846628d
|
@ -515,6 +515,8 @@ bool XMLUtil::ToDouble( const char* str, double* value )
|
||||||
|
|
||||||
char* XMLDocument::Identify( char* p, XMLNode** node )
|
char* XMLDocument::Identify( char* p, XMLNode** node )
|
||||||
{
|
{
|
||||||
|
TIXMLASSERT( node );
|
||||||
|
TIXMLASSERT( p );
|
||||||
char* const start = p;
|
char* const start = p;
|
||||||
p = XMLUtil::SkipWhiteSpace( p );
|
p = XMLUtil::SkipWhiteSpace( p );
|
||||||
if( !*p ) {
|
if( !*p ) {
|
||||||
|
@ -577,6 +579,8 @@ char* XMLDocument::Identify( char* p, XMLNode** node )
|
||||||
p = start; // Back it up, all the text counts.
|
p = start; // Back it up, all the text counts.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TIXMLASSERT( returnNode );
|
||||||
|
TIXMLASSERT( p );
|
||||||
*node = returnNode;
|
*node = returnNode;
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
@ -844,9 +848,6 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEnd )
|
||||||
XMLNode* node = 0;
|
XMLNode* node = 0;
|
||||||
|
|
||||||
p = _document->Identify( p, &node );
|
p = _document->Identify( p, &node );
|
||||||
if ( p == 0 || node == 0 ) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
StrPair endTag;
|
StrPair endTag;
|
||||||
p = node->ParseDeep( p, &endTag );
|
p = node->ParseDeep( p, &endTag );
|
||||||
|
|
Loading…
Reference in New Issue