diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1998-06-11 01:34:11 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1998-06-11 01:34:11 +0000 |
commit | 51fd26726d0141217d776a55a8c3fae410db6527 (patch) | |
tree | ecea3829503e4d132a51280b84784e47ec3aa166 /sys/lib/libsa/ctime.c | |
parent | 281a4fc4a0494a68527aa1d0cc801abd22707d36 (diff) |
fix leap year
Diffstat (limited to 'sys/lib/libsa/ctime.c')
-rw-r--r-- | sys/lib/libsa/ctime.c | 5 |
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]), |