mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-25 03:17:52 +02:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user