mirror of
https://github.com/deadw00d/AROS.git
synced 2026-03-21 04:36:15 +00:00
Backport: Don't leave tm_gmoff and tm_none uninitialized
tm can come from user stack and doesn't have to be initialized to zero. Additionally set isdst to 0 to mark and UTC does not contain DST. Set gmtoff to 0 which is value value.
This commit is contained in:
@ -1,14 +1,9 @@
|
||||
/*
|
||||
Copyright (C) 1995-2012, The AROS Development Team. All rights reserved.
|
||||
Copyright (C) 1995-2024, The AROS Development Team. All rights reserved.
|
||||
|
||||
Convert a time into UTC, reentrant.
|
||||
*/
|
||||
|
||||
/* At the moment no daylight saving time information
|
||||
* Implementation has to be changed when DST is implemented in AROS
|
||||
*/
|
||||
static int __dstflag = -1;
|
||||
|
||||
static char monthtable[] =
|
||||
{
|
||||
/* JanFebMarAprMayJunJulAugSepOktNov */
|
||||
@ -27,8 +22,8 @@ static char monthtable[] =
|
||||
struct tm * tm)
|
||||
|
||||
/* FUNCTION
|
||||
The gmtime_r() function converts the calendar time tt to
|
||||
broken-down time representation, expressed in Coordinated Universal
|
||||
The gmtime_r() function converts the calendar time tt (assumed to be UTC)
|
||||
to broken-down time representation, expressed in Coordinated Universal
|
||||
Time (UTC).
|
||||
|
||||
|
||||
@ -156,7 +151,9 @@ static char monthtable[] =
|
||||
tm->tm_mon = i;
|
||||
tm->tm_mday = tim + 1;
|
||||
|
||||
tm->tm_isdst = __dstflag;
|
||||
tm->tm_isdst = 0;
|
||||
tm->tm_gmtoff = 0;
|
||||
tm->tm_zone = NULL;
|
||||
|
||||
return tm;
|
||||
} /* gmtime */
|
||||
|
||||
Reference in New Issue
Block a user