summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/lib
diff options
context:
space:
mode:
authordanny <danny@FreeBSD.org>1999-01-16 01:51:03 +0000
committerdanny <danny@FreeBSD.org>1999-01-16 01:51:03 +0000
commit5eb872561f1cd0a4778a1e9004a90e8d629852fb (patch)
treec14df2930bf0f728bfcb8872ee8abd4f3483d660 /usr.sbin/cron/lib
parent1e7d8593e5878725fe94052469e222cbabf5705e (diff)
downloadFreeBSD-src-5eb872561f1cd0a4778a1e9004a90e8d629852fb.zip
FreeBSD-src-5eb872561f1cd0a4778a1e9004a90e8d629852fb.tar.gz
y2k nit: print 4 digit years correctly.
PR: 9506 Submitted by: Peter Jeremy <peter.jeremy@alcatel.com.au>
Diffstat (limited to 'usr.sbin/cron/lib')
-rw-r--r--usr.sbin/cron/lib/misc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/cron/lib/misc.c b/usr.sbin/cron/lib/misc.c
index 6c098de..3e03182 100644
--- a/usr.sbin/cron/lib/misc.c
+++ b/usr.sbin/cron/lib/misc.c
@@ -17,7 +17,7 @@
#if !defined(lint) && !defined(LINT)
static const char rcsid[] =
- "$Id: misc.c,v 1.5 1997/02/22 16:05:08 peter Exp $";
+ "$Id: misc.c,v 1.6 1997/09/15 06:39:25 charnier Exp $";
#endif
/* vix 26jan87 [RCS has the rest of the log]
@@ -619,9 +619,12 @@ arpadate(clock)
{
time_t t = clock ?*clock :time(0L);
struct tm *tm = localtime(&t);
- static char ret[30]; /* zone name might be >3 chars */
+ static char ret[32]; /* zone name might be >3 chars */
- (void) sprintf(ret, "%s, %2d %s %2d %02d:%02d:%02d %s",
+ if (tm->tm_year >= 100)
+ tm->tm_year += 1900;
+
+ (void) snprintf(ret, sizeof(ret), "%s, %2d %s %d %02d:%02d:%02d %s",
DowNames[tm->tm_wday],
tm->tm_mday,
MonthNames[tm->tm_mon],
OpenPOWER on IntegriCloud