2008-06-25
2008-06-25 16:35:31 by Martin Stjernholm <mast@lysator.liu.se>
-
8e71e5d754dfb0c1113d223889c4188320ec1b57
(7 lines)
(+4/-3)
[
Show
| Annotate
]
Branch: 7.9
Fix when gmtime gets an invalid timestamp on windows.
Rev: src/builtin_functions.c:1.675
2:
|| This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information.
- || $Id: builtin_functions.c,v 1.674 2008/06/23 20:56:52 mast Exp $
+ || $Id: builtin_functions.c,v 1.675 2008/06/25 16:35:31 mast Exp $
*/
#include "global.h"
5092: Inside #if defined (HAVE_GMTIME) || defined (HAVE_GMTIME_R) || defined (HAVE_GMTIME_S) and #if defined(HAVE_GMTIME_R)
#ifdef HAVE_GMTIME_R
tm = gmtime_r (&t, &tm_s);
#elif defined (HAVE_GMTIME_S)
- if (!gmtime_s (&tm_s, &t)) tm = &tm_s;
+ if (!gmtime_s (&tm_s, &t)) tm = &tm_s; else tm = NULL;
#else
tm = gmtime(&t);
#endif
if (!tm) Pike_error ("gmtime() on this system cannot handle "
- "the timestamp %ld.\n", (long) t);
+ "the timestamp %"PRINTLONGEST"d.\n", (LONGEST) t);
pop_n_elems(args);
encode_struct_tm(tm);