aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_html.c
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@netbsd.org>2011-11-18 17:05:50 +0000
committerJoerg Sonnenberger <joerg@netbsd.org>2011-11-18 17:05:50 +0000
commitc8f693f9cc317f3b40dcd20fc38eefc4fa254218 (patch)
treec84c8a126764b0a1c3488f9879bf4af4b67e71de /man_html.c
parentb5a40631c2897991e048c3dca0ec5e35e1c40532 (diff)
downloadmandoc-c8f693f9cc317f3b40dcd20fc38eefc4fa254218.tar.gz
mandoc-c8f693f9cc317f3b40dcd20fc38eefc4fa254218.tar.zst
mandoc-c8f693f9cc317f3b40dcd20fc38eefc4fa254218.zip
Don't depend on snprintf to handle NULL strings. Deal with missing date.
Diffstat (limited to 'man_html.c')
-rw-r--r--man_html.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/man_html.c b/man_html.c
index 0965c8c0..580ef779 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.83 2011/10/09 22:10:53 schwarze Exp $ */
+/* $Id: man_html.c,v 1.84 2011/11/18 17:05:50 joerg Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -305,7 +305,8 @@ man_root_pre(MAN_ARGS)
if (m->vol)
(void)strlcat(b, m->vol, BUFSIZ);
- snprintf(title, BUFSIZ - 1, "%s(%s)", m->title, m->msec);
+ snprintf(title, BUFSIZ - 1, "%s(%s)", m->title ? m->title : "",
+ m->msec ? m->msec : "");
PAIR_SUMMARY_INIT(&tag[0], "Document Header");
PAIR_CLASS_INIT(&tag[1], "head");
@@ -359,7 +360,8 @@ man_root_post(MAN_ARGS)
PAIR_CLASS_INIT(&tag[0], "foot-date");
print_otag(h, TAG_TD, 1, tag);
- print_text(h, m->date);
+ if (m->date)
+ print_text(h, m->date);
print_stagq(h, tt);
PAIR_CLASS_INIT(&tag[0], "foot-os");