Commit 21b00035 authored by Paul Eggert's avatar Paul Eggert

gtimezone: get 64-bit data from version-3 TZif files

Version 3 was introduced in tzdb 2013e (2013).
See Internet RFC 8536 section 3.1 under "ver(sion)".
parent 735c80dc
......@@ -534,7 +534,7 @@ init_zone_from_iana_info (GTimeZone *gtz,
g_return_if_fail (size >= sizeof (struct tzhead) &&
memcmp (header, "TZif", 4) == 0);
if (header->tzh_version == '2')
if (header->tzh_version >= '2')
{
/* Skip ahead to the newer 64-bit data if it's available. */
header = (const struct tzhead *)
......@@ -574,7 +574,7 @@ init_zone_from_iana_info (GTimeZone *gtz,
for (index = 0; index < time_count; index++)
{
Transition trans;
if (header->tzh_version == '2')
if (header->tzh_version >= '2')
trans.time = gint64_from_be (((gint64_be*)tz_transitions)[index]);
else
trans.time = gint32_from_be (((gint32_be*)tz_transitions)[index]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment