Commit 25942f01 authored by Philip Withnall's avatar Philip Withnall

Merge branch 'array-size' into 'master'

Fix size of preallocated array

See merge request gvdb!3
parents 1fb31a16 7bf49c8d
......@@ -462,7 +462,7 @@ gvdb_table_get_names (GvdbTable *table,
{
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++)
if (names[i] != NULL)
g_ptr_array_add (fixed_names, names[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment