summaryrefslogtreecommitdiffstats
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-30 22:04:44 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-30 22:04:44 +0000
commit36097423ac8b35b42f700e0b63e3b6ac44d88235 (patch)
tree78f67f15282d27b3e96c4558595ba0edb760cd0c /mdoc_html.c
parentbfdc50c69f00d233ff869c3f3590ad37e1aa0be7 (diff)
downloadmandoc-36097423ac8b35b42f700e0b63e3b6ac44d88235.tar.gz
Have pity on the poor stack.
Replace tail recursion by iteration when walking the syntax trees. No functional change.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index 6165050e..04729d15 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -371,9 +371,10 @@ static void
print_mdoc_nodelist(MDOC_ARGS)
{
- print_mdoc_node(meta, n, h);
- if (n->next)
- print_mdoc_nodelist(meta, n->next, h);
+ while (n != NULL) {
+ print_mdoc_node(meta, n, h);
+ n = n->next;
+ }
}
static void