summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-01-30 22:04:16 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-01-30 22:04:16 +0000
commitafbeaa94f798f89e36b08fc33937c42fd09eb113 (patch)
tree5062d5230c0e8184cb49442e7e219ee80305e747 /usr.bin/mandoc/mdoc_term.c
parent6d56af274a91080979d1e7bfe78d5b95f6ae0e28 (diff)
Have pity on the poor stack.
Replace tail recursion by iteration when walking the syntax trees. No functional change.
Diffstat (limited to 'usr.bin/mandoc/mdoc_term.c')
-rw-r--r--usr.bin/mandoc/mdoc_term.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index 7778ccd9a3f..3e8942f2480 100644
--- a/usr.bin/mandoc/mdoc_term.c
+++ b/usr.bin/mandoc/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_term.c,v 1.202 2015/01/23 14:19:52 schwarze Exp $ */
+/* $OpenBSD: mdoc_term.c,v 1.203 2015/01/30 22:04:15 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -289,9 +289,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