summaryrefslogtreecommitdiffstats
path: root/mdoc_term.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_term.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_term.c')
-rw-r--r--mdoc_term.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index c96a9ead..2b6a8c73 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -291,9 +291,10 @@ static void
print_mdoc_nodelist(DECL_ARGS)
{
- print_mdoc_node(p, pair, meta, n);
- if (n->next)
- print_mdoc_nodelist(p, pair, meta, n->next);
+ while (n != NULL) {
+ print_mdoc_node(p, pair, meta, n);
+ n = n->next;
+ }
}
static void