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;
|
node = node->parent;
|
||||||
depth--;
|
|
||||||
|
|
||||||
// write closing node
|
// write closing node
|
||||||
if (PUGI__NODETYPE(node) == node_element)
|
if (PUGI__NODETYPE(node) == node_element)
|
||||||
{
|
{
|
||||||
|
depth--;
|
||||||
|
|
||||||
if (indent_length)
|
if (indent_length)
|
||||||
text_output_indent(writer, indent, indent_length, depth);
|
text_output_indent(writer, indent, indent_length, depth);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user