From b0f0ee3842bff277048316f9c006dd16188de6c4 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 5 Jan 2010 21:48:54 +0100 Subject: Properly init GValue - don't use memset. Replace strdup with g_strdup. --- window_main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/window_main.c b/window_main.c index e502d6e..984a4e0 100644 --- a/window_main.c +++ b/window_main.c @@ -1,5 +1,3 @@ -#include - #include #include @@ -323,7 +321,7 @@ void on_foldtree_selection_changed(GtkTreeSelection *treeselection, gpointer use void on_thumbview_selection_changed(GtkIconView *iconview, gpointer user_data) { GList *list; - GValue value; + GValue value = {0}; const gchar *filename; GtkTreePath *path; GtkTreeModel *model; @@ -335,7 +333,6 @@ void on_thumbview_selection_changed(GtkIconView *iconview, gpointer user_data) { path = g_list_nth_data(list, 0); model = gtk_icon_view_get_model(iconview); gtk_tree_model_get_iter(model, &iter, path); - memset(&value, 0, sizeof(GValue)); gtk_tree_model_get_value(model, &iter, 1, &value); filename = g_value_get_string(&value); load_pixbuf(filename); @@ -444,7 +441,7 @@ void on_add_dir_action_activate(GtkAction *action, gpointer user_data) { if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { char *directory; directory = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); - add_thread = g_thread_create(add_dir_thread, strdup(directory), FALSE, &error); + add_thread = g_thread_create(add_dir_thread, g_strdup(directory), FALSE, &error); if(!add_thread) { g_warning("%s", error->message); g_error_free(error); -- cgit v1.2.3