summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-10-22 18:55:32 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-10-22 18:55:32 +0000
commitcd3461ed2decce6e980d3a4c93c615bd8f4cb5c0 (patch)
treed62af90d1db9db8f0dd241d06a9e221234572467 /mdoc_term.c
parent97e702f1687ec3975b215d6ea566bf1d6aca30a8 (diff)
downloadmandoc-cd3461ed2decce6e980d3a4c93c615bd8f4cb5c0.tar.gz
mandoc-cd3461ed2decce6e980d3a4c93c615bd8f4cb5c0.tar.zst
mandoc-cd3461ed2decce6e980d3a4c93c615bd8f4cb5c0.zip
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.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index ad4e0640..d427c1d0 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.93 2009/10/19 15:18:30 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.94 2009/10/22 18:55:32 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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);
}