Hi Paul,
Fix works for issues I've mentioned.
However, I think overflow happens somewhere. 
Please see the attached code.
I've run it in the same way as in the first message.

On my workstation it prints following:
sizeof time_t: 8
2120284800
-1
-218154496
-1


On Sun, 20 Feb 2022 at 21:32, Paul Eggert <eggert@cs.ucla.edu> wrote:
On 2/17/22 05:09, Almaz Mingaleev via tz wrote:

> With a truncated TZif file it prints 331344000. With non-truncated one it
> prints 331372800.
> The latter is the right answer.

Thanks for reporting that. I installed the attached proposed patches;
the first should fix it and the second updates a related comment.

This seems to be my weekend for fixing mktime bugs, as I fixed one in
glibc yesterday involving time in Indiana <https://bugs.gnu.org/48085>.