=================================================================== RCS file: /cvs/mandoc/man_html.c,v retrieving revision 1.93 retrieving revision 1.96 diff -u -p -r1.93 -r1.96 --- mandoc/man_html.c 2014/04/20 16:46:04 1.93 +++ mandoc/man_html.c 2014/08/01 19:25:52 1.96 @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.93 2014/04/20 16:46:04 schwarze Exp $ */ +/* $Id: man_html.c,v 1.96 2014/08/01 19:25:52 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2013, 2014 Ingo Schwarze @@ -28,6 +28,7 @@ #include #include "mandoc.h" +#include "mandoc_aux.h" #include "out.h" #include "html.h" #include "man.h" @@ -302,15 +303,11 @@ man_root_pre(MAN_ARGS) { struct htmlpair tag[3]; struct tag *t, *tt; - char b[BUFSIZ], title[BUFSIZ]; + char *title; - b[0] = 0; - if (man->vol) - (void)strlcat(b, man->vol, BUFSIZ); - assert(man->title); assert(man->msec); - snprintf(title, BUFSIZ - 1, "%s(%s)", man->title, man->msec); + mandoc_asprintf(&title, "%s(%s)", man->title, man->msec); PAIR_SUMMARY_INIT(&tag[0], "Document Header"); PAIR_CLASS_INIT(&tag[1], "head"); @@ -333,7 +330,8 @@ man_root_pre(MAN_ARGS) PAIR_CLASS_INIT(&tag[0], "head-vol"); PAIR_INIT(&tag[1], ATTR_ALIGN, "center"); print_otag(h, TAG_TD, 2, tag); - print_text(h, b); + if (NULL != man->vol) + print_text(h, man->vol); print_stagq(h, tt); PAIR_CLASS_INIT(&tag[0], "head-rtitle"); @@ -341,6 +339,7 @@ man_root_pre(MAN_ARGS) print_otag(h, TAG_TD, 2, tag); print_text(h, title); print_tagq(h, t); + free(title); } static void @@ -389,7 +388,7 @@ man_br_pre(MAN_ARGS) if ( ! a2roffsu(n->string, &su, SCALE_VS)) SCALE_VS_INIT(&su, atoi(n->string)); } else - su.scale = 0; + su.scale = 0.0; bufinit(h); bufcat_su(h, "height", &su);