* mdocml: Don't depend on snprintf to handle NULL strings.
@ 2011-11-18 17:05 joerg
0 siblings, 0 replies; only message in thread
From: joerg @ 2011-11-18 17:05 UTC (permalink / raw)
To: source
Log Message:
-----------
Don't depend on snprintf to handle NULL strings. Deal with missing date.
Modified Files:
--------------
mdocml:
man_html.c
Revision Data
-------------
Index: man_html.c
===================================================================
RCS file: /home/joerg/cvsroot/mdocml/man_html.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -Lman_html.c -Lman_html.c -u -p -r1.83 -r1.84
--- man_html.c
+++ man_html.c
@@ -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");
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-11-18 17:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-18 17:05 mdocml: Don't depend on snprintf to handle NULL strings joerg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).