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.
This commit is contained in:
parent
313aebb964
commit
77c3cb50fb
1 changed files with 1 additions and 1 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue