gconvert: Add an assertion to help static analysis

`g_convert()` returns `NULL` iff it returns an error, but the static
analyser can’t quite work that out. Add an assertion to help.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Coverity CID: #1486844
This commit is contained in:
Philip Withnall 2022-05-05 11:19:50 +01:00
parent 0c6a1af9d6
commit b810bdc94d

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);