[tz] source code question regarding localtime.c PS
Alois Treindl
alois at astro.ch
Wed Aug 7 13:09:28 UTC 2013
In localtime.c, function localsub() are these three lines of code:
1295 icycles = tcycles;
1296 if (tcycles - icycles >= 1 || icycles - tcycles >= 1)
1297 return NULL;
I do not understand the reason why lines 1296 and 1297 exist.
icycles and tcycles are equal.
Their difference is always zero. Why test for it being not zero?
PS: the reason why I am asking:
I try to understand the source code of zdump.c
It calls localtime() frequently, and has some cryptic code which depends
on whether localtime() returned NULL.
Therefore, I try to understand the conditions under which localtime()
returns NULL. If that would be documented somewhee (I may have
overlooked it), it would be great, as it is rather hard to understand it
out of the terse code.
More information about the tz
mailing list