summaryrefslogtreecommitdiff
path: root/textproc/json-glib/patches/patch-aa
blob: dc627a2e6070e21ed46820920a3c72c7b272ccb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$NetBSD: patch-aa,v 1.1.1.1 2008/11/05 13:07:14 obache Exp $

http://bugzilla.openedhand.com/show_bug.cgi?id=1203

--- json-glib/json-gobject.c.orig	2008-05-20 09:04:47.000000000 +0000
+++ json-glib/json-gobject.c
@@ -189,7 +189,7 @@ json_deserialize_pspec (GValue     *valu
         {
           JsonArray *array = json_node_get_array (node);
           guint i, array_len = json_array_get_length (array);
-          GPtrArray *str_array = g_ptr_array_sized_new (array_len);
+          GPtrArray *str_array = g_ptr_array_sized_new (array_len + 1);
 
           for (i = 0; i < array_len; i++)
             {
@@ -201,6 +201,7 @@ json_deserialize_pspec (GValue     *valu
               if (json_node_get_string (val) != NULL);
                 g_ptr_array_add (str_array, (gpointer) json_node_get_string (val));
             }
+          g_ptr_array_add (str_array, NULL);
 
           g_value_set_boxed (value, str_array->pdata);