Merge branch 'wip/smcv/gptrarray-null-term' into 'main'

garray: Update NULL termination after copying array content

Closes #2877

See merge request GNOME/glib!3190
This commit is contained in:
Simon McVittie 2023-01-10 19:51:57 +00:00
commit 1955497993

View File

@ -1387,6 +1387,9 @@ ptr_array_new_from_array (gpointer *data,
memcpy (rarray->pdata, data, len * sizeof (gpointer));
}
if (null_terminated && rarray->pdata != NULL)
rarray->pdata[len] = NULL;
rarray->len = len;
return array;