From b0df99ee07933dac07e6581a629a0711131f500f Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 7 Oct 2009 12:19:39 +0000 Subject: Header buffers in -man -Tascii are static. --- man_term.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/man_term.c b/man_term.c index 8bf4cabe..e130f4f6 100644 --- a/man_term.c +++ b/man_term.c @@ -919,15 +919,12 @@ static void print_foot(struct termp *p, const struct man_meta *meta) { struct tm *tm; - char *buf; - - if (NULL == (buf = malloc(p->rmargin))) - err(EXIT_FAILURE, "malloc"); + char buf[BUFSIZ]; tm = localtime(&meta->date); if (0 == strftime(buf, p->rmargin, "%B %d, %Y", tm)) - err(EXIT_FAILURE, "strftime"); + (void)strlcpy(buf, "(invalid date)", BUFSIZ); term_vspace(p); @@ -948,8 +945,6 @@ print_foot(struct termp *p, const struct man_meta *meta) term_word(p, buf); term_flushln(p); - - free(buf); } -- cgit