From MSDN Library:
localtime returns a pointer to the
structure result. If the value in
timer represents a date before midnight, January 1, 1970, localtime
returns NULL.
The same %^&* happens with gmtime, ctime. All calls of gmtime and ctime
that I found are protected by checks whether the result is sero (NULL).
But calls to localtime are not protected.
Nick.
intro: "VS" == Ville Skytt <Ville> writes:
VS> On Fri, 2002-03-29 at 12:59, Nick V. Pakoulin wrote:
> Happens in both xemacs-21.4 and latest XEmacs beta on Windows.
The
> problem is that list_to_time allows negative integers at the head of
> the time list. Hence a negative time is returned. In the case
> localtime on Windows returns NULL. The code does not check for it.
>
> The patch below fixes the problem. It was tested on Windows 2000.
VS> [...]
VS> I didn't test the patch, but 21.4.6 on Linux (from RedHat's rawhide)
VS> doesn't crash:
VS> M-x eval-expr (format-time-string "%s" '(-1 0 0))
"4294901760"
VS> -- Ville Skyttä ville.skytta(a)xemacs.org