summaryrefslogtreecommitdiffstats
path: root/sys/lib
diff options
context:
space:
mode:
authormickey <mickey@openbsd.org>1998-06-11 01:34:10 +0000
committermickey <mickey@openbsd.org>1998-06-11 01:34:10 +0000
commit333ea69f115d380a1b578aacd3bae28bd80b11c7 (patch)
treea196f9d8888f20f6df261d8ed6155cf3924bacb7 /sys/lib
parenthandle IPSec processed packets (DLT_ENC) in libpcap, display them with (diff)
downloadwireguard-openbsd-333ea69f115d380a1b578aacd3bae28bd80b11c7.tar.xz
wireguard-openbsd-333ea69f115d380a1b578aacd3bae28bd80b11c7.zip
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]),