diff options
author | Joerg Sonnenberger <joerg@netbsd.org> | 2011-11-18 17:05:50 +0000 |
---|---|---|
committer | Joerg Sonnenberger <joerg@netbsd.org> | 2011-11-18 17:05:50 +0000 |
commit | 89dc0a1f5618d71e7f85a54d18875bf66352caf3 (patch) | |
tree | 459b5e68569ef260c89191342abd6e682dbca1a9 | |
parent | 31bff0d8373809f1134dded2e446815d7cb4d8ac (diff) | |
download | mandoc-89dc0a1f5618d71e7f85a54d18875bf66352caf3.tar.gz |
Don't depend on snprintf to handle NULL strings. Deal with missing date.
-rw-r--r-- | man_html.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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"); |