On Tue, Jan 21, 2014 at 09:08:18PM +1300, Philip Guenther wrote: > On Tue, Jan 21, 2014 at 8:33 PM, Otto Moerbeek <o...@drijf.net> wrote: > ... > > Right. what happens is that localtime(3) returns NULL, because the > > year is not representable as an int. struct tm.tm_year must be an int > > according to posix. > > > > The diff below catches the case. > > ok guenther@ > > > > But it does not solve that 64-bit > > time_t can represent years that do not fit into the int sized tm_year. > > Sure, and before there was the problem that there were struct > localtime values that mktime() could not convert to a time_t. Lacking > types of fractional bit width, we have to live with one or the other, > no?
indeed, it's one or the other. I need to check which of the time functions can returns NULL. The man page is awfully silent on that. -Otto > > > Philip Guenther