summaryrefslogtreecommitdiffstats
path: root/man_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-01-17 15:32:43 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-01-17 15:32:43 +0000
commite0ab88fccf99335566d214b53e13683b1391271c (patch)
tree1cf126fcb186a1779a94672306c9537ddf529e89 /man_html.c
parent3786665f3a0f980a9bbbcb5cd8d674cc679491ab (diff)
downloadmandoc-e0ab88fccf99335566d214b53e13683b1391271c.tar.gz
Completely delete the buf field of struct html and all the buf*()
interfaces. Such a static buffer was a bad idea in the first place, causing unfixable truncation that was only prevented by triggering an assertion failure. Instead, let the small number of remaining users allocate and free their own, temporary dynamic buffers, or for the case of .Xr and .In, pass the original data to be assembled in print_otag().
Diffstat (limited to 'man_html.c')
-rw-r--r--man_html.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/man_html.c b/man_html.c
index a1163627..7b3285cc 100644
--- a/man_html.c
+++ b/man_html.c
@@ -172,14 +172,13 @@ html_man(void *arg, const struct roff_man *man)
static void
print_man_head(MAN_ARGS)
{
+ char *cp;
print_gen_head(h);
- assert(man->title);
- assert(man->msec);
- bufinit(h);
- bufcat_fmt(h, "%s(%s)", man->title, man->msec);
+ mandoc_asprintf(&cp, "%s(%s)", man->title, man->msec);
print_otag(h, TAG_TITLE, "");
- print_text(h, h->buf);
+ print_text(h, cp);
+ free(cp);
}
static void