Merge branch 'coverity-issues' into 'main'

Add a couple of assertions to help with static analysis

See merge request GNOME/glib!2635
This commit is contained in:
Sebastian Dröge 2022-05-05 12:27:17 +00:00
commit 68228995d7
2 changed files with 4 additions and 0 deletions

View File

@ -681,6 +681,8 @@ g_convert_with_fallback (const gchar *str,
if (!local_error)
return dest;
g_assert (dest == NULL);
if (!g_error_matches (local_error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE))
{
g_propagate_error (error, local_error);

View File

@ -2725,6 +2725,8 @@ g_date_strftime (gchar *s,
g_warning (G_STRLOC "Error converting results of strftime to UTF-8: %s", error->message);
g_error_free (error);
g_assert (convbuf == NULL);
s[0] = '\0';
return 0;
}