=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.188 retrieving revision 1.189 diff -u -p -r1.188 -r1.189 --- mandoc/mdoc_html.c 2014/04/20 16:46:05 1.188 +++ mandoc/mdoc_html.c 2014/04/20 20:18:12 1.189 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.188 2014/04/20 16:46:05 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.189 2014/04/20 20:18:12 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -29,6 +29,7 @@ #include #include "mandoc.h" +#include "mandoc_aux.h" #include "out.h" #include "html.h" #include "mdoc.h" @@ -514,9 +515,10 @@ mdoc_root_post(MDOC_ARGS) static int mdoc_root_pre(MDOC_ARGS) { + char b[BUFSIZ]; struct htmlpair tag[3]; struct tag *t, *tt; - char b[BUFSIZ], title[BUFSIZ]; + char *title; strlcpy(b, meta->vol, BUFSIZ); @@ -526,7 +528,7 @@ mdoc_root_pre(MDOC_ARGS) strlcat(b, ")", BUFSIZ); } - snprintf(title, BUFSIZ - 1, "%s(%s)", meta->title, meta->msec); + mandoc_asprintf(&title, "%s(%s)", meta->title, meta->msec); PAIR_SUMMARY_INIT(&tag[0], "Document Header"); PAIR_CLASS_INIT(&tag[1], "head"); @@ -557,6 +559,8 @@ mdoc_root_pre(MDOC_ARGS) print_otag(h, TAG_TD, 2, tag); print_text(h, title); print_tagq(h, t); + + free(title); return(1); }