Fix non-initialized variable and signed/unsigned mismatch in glib/gtimezone.c

This commit is contained in:
Loic Le Page 2022-01-19 19:00:52 +01:00 committed by Loïc Le Page
parent e8761bb4df
commit 499cb2cd1a

View File

@ -931,7 +931,7 @@ rules_from_windows_time_zone (const gchar *identifier,
TIME_ZONE_INFORMATION tzi; TIME_ZONE_INFORMATION tzi;
DWORD size; DWORD size;
guint rules_num = 0; guint rules_num = 0;
RegTZI regtzi, regtzi_prev; RegTZI regtzi = { 0 }, regtzi_prev;
WCHAR winsyspath[MAX_PATH]; WCHAR winsyspath[MAX_PATH];
gunichar2 *subkey_w, *subkey_dynamic_w; gunichar2 *subkey_w, *subkey_dynamic_w;
@ -1127,7 +1127,7 @@ find_relative_date (TimeZoneDate *buffer)
g_date_set_dmy (&date, 1, buffer->mon, buffer->year); g_date_set_dmy (&date, 1, buffer->mon, buffer->year);
first_wday = g_date_get_weekday (&date); first_wday = g_date_get_weekday (&date);
if (first_wday > wday) if ((guint) first_wday > wday)
++(buffer->week); ++(buffer->week);
/* week is 1 <= w <= 5, we need 0-based */ /* week is 1 <= w <= 5, we need 0-based */
days = 7 * (buffer->week - 1) + wday - first_wday; days = 7 * (buffer->week - 1) + wday - first_wday;