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
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue