]> Savannah Git Hosting - gnulib.git/commitdiff
mktime: fix timegm bug that set tmp->tm_isdst
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Oct 2024 02:01:30 +0000 (19:01 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Oct 2024 04:14:58 +0000 (21:14 -0700)
* lib/timegm.c (__timegm64): Omit now-unnecessary initialization
of tm_isdst.  Anyway, the initialization was always wrong, since
timegm should not modify *TMP when it fails.

ChangeLog
lib/timegm.c

index 6d8a1a52b3c5c103464168d58e54743e43f8088a..cea31f84e6ece2710f4ee3dce725ebd5d4710250 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2024-10-04  Paul Eggert  <eggert@cs.ucla.edu>
 
+       mktime: fix timegm bug that set tmp->tm_isdst
+       * lib/timegm.c (__timegm64): Omit now-unnecessary initialization
+       of tm_isdst.  Anyway, the initialization was always wrong, since
+       timegm should not modify *TMP when it fails.
+
        mktime: refactor to get closer to glibc
        * lib/mktime.c (convert_time): Reorder args.
        (__tz_convert): New macro.  All convert_time callers changed to use it.
index 1f1f66c61b84773937fea094dd3bf09d0c40c6c1..ba28b3ecd96316a264c6ce58dc6b3d5b784c8a3f 100644 (file)
@@ -30,7 +30,6 @@ __time64_t
 __timegm64 (struct tm *tmp)
 {
   static mktime_offset_t gmtime_offset;
-  tmp->tm_isdst = 0;
   return __mktime_internal (tmp, false, &gmtime_offset);
 }