summaryrefslogtreecommitdiffstats
path: root/mdoc_action.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-18 20:46:19 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-18 20:46:19 +0000
commit02772d7cbebdade86dabcbbc9d19e72db2bd0b43 (patch)
treecd69db8c6dcccdbdc0b519f7d88aaacc22dbac4d /mdoc_action.c
parente2d8679f361643c8410c69f218268085075bc428 (diff)
downloadmandoc-02772d7cbebdade86dabcbbc9d19e72db2bd0b43.tar.gz
Added nchild decrement in libman (not used, but better in than forgotten).
Added nchild to libmdoc, deprecated count() functions in validator.
Diffstat (limited to 'mdoc_action.c')
-rw-r--r--mdoc_action.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mdoc_action.c b/mdoc_action.c
index 81e26e6a..e1517a11 100644
--- a/mdoc_action.c
+++ b/mdoc_action.c
@@ -663,11 +663,9 @@ post_bl_head(POST_ARGS)
* column field. Then, delete the head children.
*/
- for (i = 0, nn = m->last->child; nn; nn = nn->next, i++)
- /* Count children. */;
-
- n->args->argv[c].sz = (size_t)i;
- n->args->argv[c].value = malloc((size_t)i * sizeof(char *));
+ n->args->argv[c].sz = (size_t)m->last->nchild;
+ n->args->argv[c].value = malloc
+ ((size_t)m->last->nchild * sizeof(char *));
for (i = 0, nn = m->last->child; nn; i++) {
n->args->argv[c].value[i] = nn->string;
@@ -677,7 +675,9 @@ post_bl_head(POST_ARGS)
mdoc_node_free(nnp);
}
+ m->last->nchild = 0;
m->last->child = NULL;
+
return(1);
}