gio: Use g_memdup2() instead of g_memdup() in obvious places

Convert all the call sites which use `g_memdup()`’s length argument
trivially (for example, by passing a `sizeof()`), so that they use
`g_memdup2()` instead.

In almost all of these cases the use of `g_memdup()` would not have
caused problems, but it will soon be deprecated, so best port away from
it.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #2319
This commit is contained in:
Philip Withnall
2021-02-04 13:37:56 +00:00
parent f8cf0b8672
commit 73b293fd30
8 changed files with 19 additions and 19 deletions

View File

@@ -147,9 +147,9 @@ prepare_data (SetupData *data,
data->expected_size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (data->data_stream));
g_assert_cmpint (data->expected_size, >, 0);
g_assert_cmpuint (data->expected_size, >, 0);
data->expected_output = g_memdup (written, (guint)data->expected_size);
data->expected_output = g_memdup2 (written, data->expected_size);
/* then recreate the streams and prepare them for the asynchronous close */
destroy_streams (data);