mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-28 10:30:03 +01: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:
commit
d3356bdbe9
@ -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));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user