mktime fix

François Gouget fgouget at codeweavers.com
Tue Dec 4 20:36:31 CST 2001


Changelog:

   François Gouget <fgouget at codeweavers.com>

 * dlls/msvcrt/time.c
   mktime must normalize the struct tm fields


-- 
François Gouget
fgouget at codeweavers.com
-------------- next part --------------
Index: dlls/msvcrt/time.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/time.c,v
retrieving revision 1.6
diff -u -r1.6 time.c
--- dlls/msvcrt/time.c	2001/11/12 15:47:26	1.6
+++ dlls/msvcrt/time.c	2001/12/05 00:35:00
@@ -37,6 +37,7 @@
  */
 MSVCRT_time_t MSVCRT_mktime(struct MSVCRT_tm *t)
 {
+  MSVCRT_time_t res;
   struct tm aa;
 
   aa.tm_sec = t->tm_sec;
@@ -46,7 +47,11 @@
   aa.tm_mon = t->tm_mon;
   aa.tm_year = t->tm_year;
   aa.tm_isdst = t->tm_isdst;
-  return mktime(&aa);
+  res=mktime(&aa);
+  if (res!=-1) {
+    memcpy(t,&aa,sizeof(*t));
+  }
+  return res;
 }
 
 /**********************************************************************


More information about the wine-patches mailing list