diff options
| author | Hui Su <[email protected]> | 2026-08-18 19:34:04 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-08-21 09:44:42 +0800 |
| commit | 339bffb702b911b55b0e6d54fa5ad9116295f048 (patch) | |
| tree | ba424c2e73738da6b35177628362f9f69b7db4d1 /documentation/3.kernel/basic/basic.md | |
| parent | 7d1e55154932edc4038b7a01072ec66686f01427 (diff) | |
[fix][libc] fix timegm month overflow calculation
The original overflow logic used __spm[tm_mon] as the current month's
length when normalizing tm_mday. This produced incorrect dates after
crossing month boundaries and left zero or negative days unnormalized.
Use the difference between adjacent cumulative day offsets with
leap-year handling. Normalize overflow in tm_sec, tm_min, tm_hour,
tm_mday, and tm_mon to keep the affected broken-down fields normalized.
Add regression tests for month boundaries, leap years, large offsets,
zero and negative days, negative time fields, combined overflow, and
boundary carry cases.
Close #11686
Signed-off-by: Hui Su <[email protected]>
Diffstat (limited to 'documentation/3.kernel/basic/basic.md')
0 files changed, 0 insertions, 0 deletions
