mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-21 08:28:53 +02:00
Merge branch 'wip/smcv/gptrarray-memcpy-nothing' into 'main'
garray: Avoid calling memcpy with no items See merge request GNOME/glib!3192
This commit is contained in:
@@ -1382,7 +1382,7 @@ ptr_array_new_from_array (gpointer *data,
|
||||
for (gsize i = 0; i < len; i++)
|
||||
rarray->pdata[i] = copy_func (data[i], copy_func_user_data);
|
||||
}
|
||||
else
|
||||
else if (len != 0)
|
||||
{
|
||||
memcpy (rarray->pdata, data, len * sizeof (gpointer));
|
||||
}
|
||||
|
Reference in New Issue
Block a user