summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/man_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2016-01-08 17:48:05 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2016-01-08 17:48:05 +0000
commitacd4f569237dcdcc8fa8acec7b1125a2f37815a4 (patch)
treeca5b1689319be7347e802acf8150955a8dad94b2 /usr.bin/mandoc/man_html.c
parentcf6760ace1c337cbeb0f8b6842d8a4a084627f68 (diff)
Delete the redundant "nchild" member of struct roff_node, replacing
most uses by one, a few by two pointer checks, and only one by a tiny loop - not only making data smaller, but code shorter as well. This gets rid of an implicit invariant that confused both static analysis tools and human auditors. No functional change.
Diffstat (limited to 'usr.bin/mandoc/man_html.c')
-rw-r--r--usr.bin/mandoc/man_html.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c
index a1adad2cda1..4fc98977e85 100644
--- a/usr.bin/mandoc/man_html.c
+++ b/usr.bin/mandoc/man_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_html.c,v 1.72 2015/10/06 18:30:43 schwarze Exp $ */
+/* $OpenBSD: man_html.c,v 1.73 2016/01/08 17:48:04 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -652,7 +652,7 @@ man_UR_pre(MAN_ARGS)
n = n->child;
assert(n->type == ROFFT_HEAD);
- if (n->nchild) {
+ if (n->child != NULL) {
assert(n->child->type == ROFFT_TEXT);
PAIR_CLASS_INIT(&tag[0], "link-ext");
PAIR_HREF_INIT(&tag[1], n->child->string);
@@ -660,7 +660,7 @@ man_UR_pre(MAN_ARGS)
}
assert(n->next->type == ROFFT_BODY);
- if (n->next->nchild)
+ if (n->next->child != NULL)
n = n->next;
print_man_nodelist(man, n->child, mh, h);