summaryrefslogtreecommitdiff
path: root/gsearchtool/gsearchtool-callbacks.c
diff options
context:
space:
mode:
authorMonsta <[email protected]>2015-01-05 17:07:57 +0300
committerStefano Karapetsas <[email protected]>2015-01-14 08:03:31 +0100
commitb64314302f4aec2740c6c06f8e44b8e14d0ad12d (patch)
treea4931ed2645f6bfaf4cb3efa56ec6800b5c9a9b8 /gsearchtool/gsearchtool-callbacks.c
parent946b345520b1c7673c4a6c2c3fcf3286030830ba (diff)
downloadmate-utils-b64314302f4aec2740c6c06f8e44b8e14d0ad12d.tar.bz2
mate-utils-b64314302f4aec2740c6c06f8e44b8e14d0ad12d.tar.xz
gsearchtool: safer access to list element's data
g_list_nth_data just returns NULL if either list or element is NULL Closes https://github.com/mate-desktop/mate-utils/pull/87
Diffstat (limited to 'gsearchtool/gsearchtool-callbacks.c')
-rw-r--r--gsearchtool/gsearchtool-callbacks.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gsearchtool/gsearchtool-callbacks.c b/gsearchtool/gsearchtool-callbacks.c
index be2244e9..0c040867 100644
--- a/gsearchtool/gsearchtool-callbacks.c
+++ b/gsearchtool/gsearchtool-callbacks.c
@@ -486,7 +486,7 @@ open_file_cb (GtkMenuItem * action,
GtkTreeIter iter;
gtk_tree_model_get_iter (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter,
- g_list_nth (list, idx)->data);
+ g_list_nth_data (list, idx));
gtk_tree_model_get (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter,
COLUMN_NAME, &utf8_name,
@@ -619,7 +619,7 @@ open_folder_cb (GtkAction * action,
GtkTreeIter iter;
gtk_tree_model_get_iter (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter,
- g_list_nth (list, idx)->data);
+ g_list_nth_data (list, idx));
gtk_tree_model_get (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter,
COLUMN_RELATIVE_PATH, &utf8_folder,
@@ -821,7 +821,7 @@ move_to_trash_cb (GtkAction * action,
&model);
gtk_tree_model_get_iter (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter,
- g_list_nth (list, 0)->data);
+ g_list_nth_data (list, 0));
gtk_tree_model_get (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter,
COLUMN_NAME, &utf8_basename,
@@ -1568,7 +1568,7 @@ drag_file_cb (GtkWidget * widget,
gchar * locale_file;
gtk_tree_model_get_iter (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter,
- g_list_nth (list, idx)->data);
+ g_list_nth_data (list, idx));
gtk_tree_model_get (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter,
COLUMN_NAME, &utf8_name,