mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-28 23:16:14 +01:00
Merge branch 'array-size' into 'master'
Fix size of preallocated array See merge request GNOME/gvdb!3
This commit is contained in:
commit
25942f0176
@ -462,7 +462,7 @@ gvdb_table_get_names (GvdbTable *table,
|
|||||||
{
|
{
|
||||||
GPtrArray *fixed_names;
|
GPtrArray *fixed_names;
|
||||||
|
|
||||||
fixed_names = g_ptr_array_sized_new (n_names);
|
fixed_names = g_ptr_array_sized_new (n_names + 1 /* NULL terminator */);
|
||||||
for (i = 0; i < n_names; i++)
|
for (i = 0; i < n_names; i++)
|
||||||
if (names[i] != NULL)
|
if (names[i] != NULL)
|
||||||
g_ptr_array_add (fixed_names, names[i]);
|
g_ptr_array_add (fixed_names, names[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user