From 0309be4091771471f886a7c2b3616f21ebf0fdb7 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 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'man_term.c') diff --git a/man_term.c b/man_term.c index 661c7e4c..ab720594 100644 --- a/man_term.c +++ b/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.33 2009/10/04 15:24:54 kristaps Exp $ */ +/* $Id: man_term.c,v 1.34 2009/10/07 12:19:39 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -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 v1.2.3-56-ge451