summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1998-02-14 21:07:21 +0000
committermillert <millert@openbsd.org>1998-02-14 21:07:21 +0000
commit19626bfa0e87003bca9eed75f2020e8cdb94c307 (patch)
treefaf3ca6f8fea542180d201133102c13abb4cec6a
parentChanged %c in the builtin C locale from "%D %X" to the more (diff)
downloadwireguard-openbsd-19626bfa0e87003bca9eed75f2020e8cdb94c307.tar.xz
wireguard-openbsd-19626bfa0e87003bca9eed75f2020e8cdb94c307.zip
Give correct format to strftime(3) instead of using "%c" and making
assumptions as to what that will look like (which is idiotic as %c is locale-dependent).
-rw-r--r--usr.bin/calendar/io.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c
index 3169ab3cf2b..3bc6d52b773 100644
--- a/usr.bin/calendar/io.c
+++ b/usr.bin/calendar/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.2 1997/09/12 04:12:48 millert Exp $ */
+/* $OpenBSD: io.c,v 1.3 1998/02/14 21:07:21 millert Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@@ -43,7 +43,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94";
#else
-static char rcsid[] = "$OpenBSD: io.c,v 1.2 1997/09/12 04:12:48 millert Exp $";
+static char rcsid[] = "$OpenBSD: io.c,v 1.3 1998/02/14 21:07:21 millert Exp $";
#endif
#endif /* not lint */
@@ -149,8 +149,11 @@ cal()
tm.tm_mon = month - 1;
tm.tm_mday = day;
tm.tm_year = tp->tm_year; /* unused */
- (void)strftime(dbuf, sizeof(dbuf), "%c", &tm);
- dbuf[10] = '\0';
+ tm.tm_isdst = tp->tm_isdst; /* unused */
+ tm.tm_gmtoff = tp->tm_gmtoff; /* unused */
+ tm.tm_zone = tp->tm_zone; /* unused */
+ (void)strftime(dbuf, sizeof(dbuf), "%a %b %d",
+ &tm);
(void)fprintf(fp, "%s%c%s\n",
dbuf + 4/* skip weekdays */,
var ? '*' : ' ', p);