mktime fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Changelog:

   François Gouget <fgouget@codeweavers.com>

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


-- 
François Gouget
fgouget@codeweavers.com
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;
 }
 
 /**********************************************************************

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux