summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2015-03-24 10:31:58 +0100
committerJiří Klimeš <jklimes@redhat.com>2015-03-24 10:35:52 +0100
commit978bac67673130de51dd998c44696883a0ce5ffe (patch)
tree0eac78050e181d010594b154972580eb1ea19a0e
parentb553c28fce49d4c3a2fb35dbe1291a6da440aae5 (diff)
downloadnetwork-manager-applet-978bac67673130de51dd998c44696883a0ce5ffe.tar.gz
applet: fix a crash while sorting connections
Compare function for g_ptr_array_sort() takes pointers to pointers to array items. Fixes commit 3722a190468f5ce5898db8838611bc826d3153f1.
-rw-r--r--src/applet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/applet.c b/src/applet.c
index efc345b8..ba13cbb4 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -1558,8 +1558,8 @@ add_device_items (NMDeviceType type, const GPtrArray *all_devices,
static gint
sort_connections_by_ifname (gconstpointer a, gconstpointer b)
{
- NMConnection *aa = NM_CONNECTION (a);
- NMConnection *bb = NM_CONNECTION (b);
+ NMConnection *aa = *(NMConnection **)a;
+ NMConnection *bb = *(NMConnection **)b;
return strcmp (nm_connection_get_interface_name (aa),
nm_connection_get_interface_name (bb));
@@ -1594,7 +1594,7 @@ add_virtual_items (const char *type, const GPtrArray *all_devices,
* (or reach the end of the list).
*/
while ( i < connections->len
- && sort_connections_by_ifname (connection, connections->pdata[i]) == 0)
+ && sort_connections_by_ifname (&connection, &connections->pdata[i]) == 0)
i++;
}
@@ -1618,7 +1618,7 @@ add_virtual_items (const char *type, const GPtrArray *all_devices,
iface_connections = g_ptr_array_sized_new (5);
while ( i < connections->len
- && sort_connections_by_ifname (connection, connections->pdata[i]) == 0) {
+ && sort_connections_by_ifname (&connection, &connections->pdata[i]) == 0) {
g_ptr_array_add (iface_connections, connections->pdata[i]);
i++;
}