mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 17:56:17 +01:00
gdatetime: Fix a spurious gcc warning
It’s possible to get a -Wmaybe-uninitialized warning out of this code with some GCC versions. Rework the code to avoid needing the conditional free. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=728108
This commit is contained in:
parent
68f6d39895
commit
a80117c371
@ -3197,6 +3197,7 @@ g_date_time_format_locale (GDateTime *datetime,
|
|||||||
break;
|
break;
|
||||||
case 'Z':
|
case 'Z':
|
||||||
tz = g_date_time_get_timezone_abbreviation (datetime);
|
tz = g_date_time_get_timezone_abbreviation (datetime);
|
||||||
|
tmp = NULL;
|
||||||
tmp_len = strlen (tz);
|
tmp_len = strlen (tz);
|
||||||
if (!locale_is_utf8)
|
if (!locale_is_utf8)
|
||||||
{
|
{
|
||||||
@ -3205,7 +3206,6 @@ g_date_time_format_locale (GDateTime *datetime,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
g_string_append_len (outstr, tz, tmp_len);
|
g_string_append_len (outstr, tz, tmp_len);
|
||||||
if (!locale_is_utf8)
|
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
break;
|
break;
|
||||||
case '%':
|
case '%':
|
||||||
|
Loading…
Reference in New Issue
Block a user