mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 19:36:18 +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;
|
||||
case 'Z':
|
||||
tz = g_date_time_get_timezone_abbreviation (datetime);
|
||||
tmp = NULL;
|
||||
tmp_len = strlen (tz);
|
||||
if (!locale_is_utf8)
|
||||
{
|
||||
@ -3205,7 +3206,6 @@ g_date_time_format_locale (GDateTime *datetime,
|
||||
return FALSE;
|
||||
}
|
||||
g_string_append_len (outstr, tz, tmp_len);
|
||||
if (!locale_is_utf8)
|
||||
g_free (tmp);
|
||||
break;
|
||||
case '%':
|
||||
|
Loading…
Reference in New Issue
Block a user