diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-22 18:55:32 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-22 18:55:32 +0000 |
commit | f26f75bb32fa1474ee83fcff787b6423c44189cf (patch) | |
tree | 44c7e29c549509bc9e5fd633afed4b360a966dbd /mdoc_term.c | |
parent | ee228d79036122b2d0284854cd2e94526fd838b9 (diff) | |
download | mandoc-f26f75bb32fa1474ee83fcff787b6423c44189cf.tar.gz |
Fixed maddening mismatch between groff and strftime mismatch of day ("%e"). Noted by Ulrich Sporlein.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r-- | mdoc_term.c | 12 |
1 files changed, 3 insertions, 9 deletions
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); } |