Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1:/tmp/cvs-serv7097/win32/src
Modified Files:
PyTime.cpp
Log Message:
localtime() can return NULL, but we never handled it.
Index: PyTime.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PyTime.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** PyTime.cpp 7 Nov 2003 03:58:17 -0000 1.9
--- PyTime.cpp 22 Jan 2004 04:40:22 -0000 1.10
***************
*** 181,185 ****
*/
time_t time = mktime(&tm);
! tm = *localtime(&time);
// tm.tm_wday = st.wDayOfWeek;
// tm.tm_yday = st. day of year;
--- 181,192 ----
*/
time_t time = mktime(&tm);
! /* We need a better way to format, but for now we have to live inside
! the limitations of localtime()
! */
! struct tm *local = localtime(&time);
! if (local==NULL)
! return PyErr_Format(PyExc_ValueError, "The time value is too early to be formatted");
!
! tm = *local;
// tm.tm_wday = st.wDayOfWeek;
// tm.tm_yday = st. day of year;
|