mirror of
https://github.com/zeux/pugixml.git
synced 2024-12-31 00:13:01 +08:00
Prevent depth underflow when printing documents
Since depth is unsigned this is actually well-defined but it's better to not have the underflow anyway.
This commit is contained in:
parent
853b1977b8
commit
c579d99649
@ -3643,11 +3643,12 @@ PUGI__NS_BEGIN
|
||||
}
|
||||
|
||||
node = node->parent;
|
||||
depth--;
|
||||
|
||||
// write closing node
|
||||
if (PUGI__NODETYPE(node) == node_element)
|
||||
{
|
||||
depth--;
|
||||
|
||||
if (indent_length)
|
||||
text_output_indent(writer, indent, indent_length, depth);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user