mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-14 00:06:24 +01:00
Initialise variable in g_time_val_from_iso8601()
The function does not initialise the struct tm, giving it improper values of tm_isdst making the result an hour out. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=603540
This commit is contained in:
parent
3d8035f799
commit
2321e5aed0
@ -301,7 +301,7 @@ gboolean
|
|||||||
g_time_val_from_iso8601 (const gchar *iso_date,
|
g_time_val_from_iso8601 (const gchar *iso_date,
|
||||||
GTimeVal *time_)
|
GTimeVal *time_)
|
||||||
{
|
{
|
||||||
struct tm tm;
|
struct tm tm = {0};
|
||||||
long val;
|
long val;
|
||||||
|
|
||||||
g_return_val_if_fail (iso_date != NULL, FALSE);
|
g_return_val_if_fail (iso_date != NULL, FALSE);
|
||||||
@ -399,6 +399,7 @@ g_time_val_from_iso8601 (const gchar *iso_date,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* No "Z" or offset, so local time */
|
/* No "Z" or offset, so local time */
|
||||||
|
tm.tm_isdst = -1; /* locale selects DST */
|
||||||
time_->tv_sec = mktime (&tm);
|
time_->tv_sec = mktime (&tm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user