aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit6506abee45c903b6cd5093a2bf6ece5ac7aed4e3 (patch)
tree420d0dcbb8b9af88f08f2409068672f3b64b161f /man_html.c
parent24fd28849fa784bd04e3f5bbdb7152253c5d68ba (diff)
downloadmandoc-6506abee45c903b6cd5093a2bf6ece5ac7aed4e3.tar.gz
mandoc-6506abee45c903b6cd5093a2bf6ece5ac7aed4e3.tar.zst
mandoc-6506abee45c903b6cd5093a2bf6ece5ac7aed4e3.zip
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.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/man_html.c b/man_html.c
index 9afcde06..92c5fc78 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.122 2017/01/17 01:47:51 schwarze Exp $ */
+/* $Id: man_html.c,v 1.123 2017/01/17 15:32:44 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -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