diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-01-17 15:32:43 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-01-17 15:32:43 +0000 |
commit | e0ab88fccf99335566d214b53e13683b1391271c (patch) | |
tree | 1cf126fcb186a1779a94672306c9537ddf529e89 /man_html.c | |
parent | 3786665f3a0f980a9bbbcb5cd8d674cc679491ab (diff) | |
download | mandoc-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.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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 |