summary refs log tree commit diff
path: root/libnm-glib/nm-types.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2012-03-24 01:37:02 +0100
committerMichael Biebl <biebl@debian.org>2012-03-24 01:37:02 +0100
commitde06e5715e780baade318f3490ac7a4c9ce84e32 (patch)
tree23fbc3fafc12072476eff98bee60100eb54c29db /libnm-glib/nm-types.c
parentb436a68a20ff3114ded32a7a3d70cdd4954039f9 (diff)
Imported Upstream version 0.9.4.0 upstream/0.9.4.0
Diffstat (limited to 'libnm-glib/nm-types.c')
-rw-r--r--libnm-glib/nm-types.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libnm-glib/nm-types.c b/libnm-glib/nm-types.c
index 6d76787d..098af8d8 100644
--- a/libnm-glib/nm-types.c
+++ b/libnm-glib/nm-types.c
@@ -172,9 +172,9 @@ nm_string_array_get_type (void)
 gboolean
 _nm_string_array_demarshal (GValue *value, GPtrArray **dest)
 {
-	GPtrArray *array;
+	char **array;
 
-	if (!G_VALUE_HOLDS (value, DBUS_TYPE_G_ARRAY_OF_STRING))
+	if (!G_VALUE_HOLDS (value, G_TYPE_STRV))
 		return FALSE;
 
 	if (*dest) {
@@ -182,13 +182,13 @@ _nm_string_array_demarshal (GValue *value, GPtrArray **dest)
 		*dest = NULL;
 	}
 
-	array = (GPtrArray *) g_value_get_boxed (value);
-	if (array && array->len) {
+	array = (char **) g_value_get_boxed (value);
+	if (array && array[0]) {
 		int i;
 
-		*dest = g_ptr_array_sized_new (array->len);
-		for (i = 0; i < array->len; i++)
-			g_ptr_array_add (*dest, g_strdup (g_ptr_array_index (array, i)));
+		*dest = g_ptr_array_new ();
+		for (i = 0; array[i]; i++)
+			g_ptr_array_add (*dest, g_strdup (array[i]));
 	}
 
 	return TRUE;
@@ -323,11 +323,11 @@ _nm_ip6_address_array_copy (GPtrArray *src)
 	dest = g_ptr_array_sized_new (src->len);
 	for (i = 0; i < src->len; i++) {
 		struct in6_addr *addr = g_ptr_array_index (src, i);
-		struct in6_addr *dup;
+		struct in6_addr *copy;
 
-		dup = g_malloc0 (sizeof (struct in6_addr));
-		memcpy (dup, addr, sizeof (struct in6_addr));
-		g_ptr_array_add (dest, dup);
+		copy = g_malloc0 (sizeof (struct in6_addr));
+		memcpy (copy, addr, sizeof (struct in6_addr));
+		g_ptr_array_add (dest, copy);
 	}
 	return dest;
 }