From f26f75bb32fa1474ee83fcff787b6423c44189cf Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Thu, 22 Oct 2009 18:55:32 +0000 Subject: Fixed maddening mismatch between groff and strftime mismatch of day ("%e"). Noted by Ulrich Sporlein. --- mdoc_term.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'mdoc_term.c') diff --git a/mdoc_term.c b/mdoc_term.c index 789d3454..c59c42b6 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -347,8 +347,8 @@ print_node(DECL_ARGS) static void print_foot(DECL_ARGS) { - struct tm *tm; - char *buf, *os; + char buf[DATESIZ]; + char *os; /* * Output the footer in new-groff style, that is, three columns @@ -358,15 +358,10 @@ print_foot(DECL_ARGS) * SYSTEM DATE SYSTEM */ - if (NULL == (buf = malloc(p->rmargin))) - err(EXIT_FAILURE, "malloc"); if (NULL == (os = malloc(p->rmargin))) err(EXIT_FAILURE, "malloc"); - tm = localtime(&m->date); - - if (0 == strftime(buf, p->rmargin, "%B %e, %Y", tm)) - err(EXIT_FAILURE, "strftime"); + time2a(m->date, buf, DATESIZ); (void)strlcpy(os, m->os, p->rmargin); @@ -398,7 +393,6 @@ print_foot(DECL_ARGS) p->rmargin = p->maxrmargin; p->flags = 0; - free(buf); free(os); } -- cgit