diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-07 12:19:39 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-07 12:19:39 +0000 |
commit | 0309be4091771471f886a7c2b3616f21ebf0fdb7 (patch) | |
tree | 571d1247a155fcf14200399de623002fd36a5fe6 /man_term.c | |
parent | 3b2ccd70393214cf6fb85913738a991c84ff369a (diff) | |
download | mandoc-0309be4091771471f886a7c2b3616f21ebf0fdb7.tar.gz mandoc-0309be4091771471f886a7c2b3616f21ebf0fdb7.tar.zst mandoc-0309be4091771471f886a7c2b3616f21ebf0fdb7.zip |
Header buffers in -man -Tascii are static.
Diffstat (limited to 'man_term.c')
-rw-r--r-- | man_term.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -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 <kristaps@kth.se> * @@ -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); } |