bruceg/daemontools-encore — pull request #14 by snakpak (2013-09-15 07:31:41+00:00)
Title: Fix reporting of the 1900 years beyond 2147483647.

Not that it matters much for a few more years, but once t->tm_year becomes sufficiently large, adding 1900 to it causes the result to wrap beyond INT_MAX and become negative. Once sent to fmt_ulong, the negative number becomes an extremely large positive year.

Last good second...
$ echo '@40f0c29d868c43d900000000' | tai64nlocal
2147483647-12-31 23:59:59.000000000

First bad second...
$ echo '@40f0c29d868c43da00000000' | tai64nlocal
18446744071562067968-01-01 00:00:000000000

Same second, after patch...
$ echo '@40f0c29d868c43da00000000' | tai64nlocal
2147483648-01-01 00:00:00.000000000
.