summaryrefslogtreecommitdiff
path: root/sys/lib
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1998-06-11 01:34:11 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1998-06-11 01:34:11 +0000
commit51fd26726d0141217d776a55a8c3fae410db6527 (patch)
treeecea3829503e4d132a51280b84784e47ec3aa166 /sys/lib
parent281a4fc4a0494a68527aa1d0cc801abd22707d36 (diff)
fix leap year
Diffstat (limited to 'sys/lib')
-rw-r--r--sys/lib/libsa/ctime.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/lib/libsa/ctime.c b/sys/lib/libsa/ctime.c
index 5d9b41f5db3..d98ab1a013f 100644
--- a/sys/lib/libsa/ctime.c
+++ b/sys/lib/libsa/ctime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctime.c,v 1.1 1998/05/29 20:44:49 mickey Exp $ */
+/* $OpenBSD: ctime.c,v 1.2 1998/06/11 01:34:10 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -69,6 +69,9 @@ ctime(clock)
for (month = 0; tt > monthcnt[month]; month++)
tt -= monthcnt[month];
+ if (month > 2 && isleap(year))
+ tt--;
+
/* no field widths in printf() */
sprintf(buf, "%s %s %d %d:%d:%d %d\n",
((wday < 0 || wday >= 7)? "???": wdays[wday]),