garray: Fix NULL-termination of GPtrArray copies

The code was accidentally NULL-terminating the source array rather than
the copy.

This fixes commit ee247c0a2d.

Spotted by the `array-test` installed test in
https://gitlab.gnome.org/GNOME/glib/-/jobs/2047993.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2022-06-07 09:36:57 +01:00
parent 2b437402e8
commit c11e64e7ae

View File

@ -1285,7 +1285,7 @@ g_ptr_array_copy (GPtrArray *array,
new_array->len = array->len;
}
ptr_array_null_terminate (rarray);
ptr_array_null_terminate ((GRealPtrArray *) new_array);
}
return new_array;