summaryrefslogtreecommitdiff
path: root/sys/src/libc
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2020-09-22 19:21:51 -0700
committerOri Bernstein <ori@eigenstate.org>2020-09-22 19:21:51 -0700
commit77c3cb50fb529740c57908cc5f0655fba0257c91 (patch)
tree088d6fc474dd5a5c82ec038371b19f2838ae35e6 /sys/src/libc
parent313aebb96478c37be8f39754875c02dcb3f896cc (diff)
libc: make yday 0-based, as docs suggest
Tm.yday is docuemnted as being 0-based, and our new api should respect that. Fix the code so that this is true.
Diffstat (limited to 'sys/src/libc')
-rw-r--r--sys/src/libc/port/date.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/libc/port/date.c b/sys/src/libc/port/date.c
index 44ae15696..1c90a7985 100644
--- a/sys/src/libc/port/date.c
+++ b/sys/src/libc/port/date.c
@@ -330,7 +330,7 @@ tmfill(Tm *tm, vlong abs, vlong nsec)
if(d < 0)
d += mdays[m - 1];
- tm->yday = d;
+ tm->yday = d - 1;
for(i = 0; i < m - 1; i++)
tm->yday += mdays[i];
if(m > 1 && isleap(y))