summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-01-05 21:48:54 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2010-01-05 21:48:54 +0100
commitb0f0ee3842bff277048316f9c006dd16188de6c4 (patch)
treee4ce317d5fb513e4e16f865c8968662f8a5f33d6
parentf392c5388ab29ba88bdc5ba5ad983622d77824ba (diff)
Properly init GValue - don't use memset.
Replace strdup with g_strdup.
-rw-r--r--window_main.c7
1 files 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 <string.h>
-
#include <glib/gstdio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
@@ -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);