Make gmtime/localtime properly support times near the limits of the time_t range.

They did not properly handle times in 1969 or 2105 (for the latter, they would infinite-loop).
This commit is contained in:
Stephen Heumann 2022-12-29 23:17:24 -06:00
parent b302a85fd6
commit f15caf8096
1 changed files with 7 additions and 2 deletions

View File

@ -510,22 +510,27 @@ lb1 plb
stz second
lb1 inc year
jsr factor
lda count+4
bne lb1b
lda count+2
cmp t+2
bne lb1a
lda count
cmp t
lb1a ble lb1
dec year
lb1b dec year
lb2 inc month find the month
jsr factor
lda count+4
bmi lb2
bne lb2b
lda count+2
cmp t+2
bne lb2a
lda count
cmp t
lb2a ble lb2
dec month
lb2b dec month
jsr factor recompute the factor
lda year set the year
sta tm_year