clean up the depth tracking a bit

This commit is contained in:
Lee Thomason
2018-04-05 09:24:20 -07:00
parent d946ddadc2
commit f928c35186
5 changed files with 24 additions and 16 deletions

View File

@@ -2384,21 +2384,18 @@ void XMLDocument::Parse()
ParseDeep(p, 0, &_parseCurLineNum );
}
bool XMLDocument::PushDepth()
void XMLDocument::PushDepth()
{
_parsingDepth++;
if (_parsingDepth == TINYXML2_MAX_ELEMENT_DEPTH) {
SetError(XMLError::XML_ELEMENT_DEPTH_EXCEEDED, _parseCurLineNum, "Element nesting is too deep." );
return false;
}
return true;
}
bool XMLDocument::PopDepth()
void XMLDocument::PopDepth()
{
TIXMLASSERT(_parsingDepth > 0);
--_parsingDepth;
return true;
}
XMLPrinter::XMLPrinter( FILE* file, bool compact, int depth ) :