Ensure that the path is always set

We are using `path` unconditionally, but it can be conditionally filled.
To avoid inconsistent internal state, and a compiler warning, let's
assert that the variable is always set.
This commit is contained in:
Emmanuele Bassi 2017-12-05 11:07:46 +00:00
parent 66f7f1768f
commit 51db8f8f53

View File

@ -615,7 +615,7 @@ static void
file_text_serializer (GdkContentSerializer *serializer)
{
const GValue *value;
char *path;
char *path = NULL;
value = gdk_content_serializer_get_value (serializer);
@ -651,6 +651,8 @@ file_text_serializer (GdkContentSerializer *serializer)
path = g_string_free (str, FALSE);
}
g_assert (path != NULL);
g_output_stream_write_all_async (gdk_content_serializer_get_output_stream (serializer),
path,
strlen (path),