diff --git a/xfce4-notifyd-config/main.c b/xfce4-notifyd-config/main.c index 1f3d64e..7a35b02 100644 --- a/xfce4-notifyd-config/main.c +++ b/xfce4-notifyd-config/main.c @@ -132,7 +132,7 @@ list_store_add_themes_in_dir(GtkListStore *ls, { GDir *dir; const gchar *file; - gchar buf[PATH_MAX]; + gchar *filename; dir = g_dir_open(path, 0, NULL); if(!dir) @@ -142,9 +142,8 @@ list_store_add_themes_in_dir(GtkListStore *ls, if(g_hash_table_lookup(themes_seen, file)) continue; - g_snprintf(buf, sizeof(buf), "%s/%s/xfce-notify-4.0/gtkrc", - path, file); - if(g_file_test(buf, G_FILE_TEST_IS_REGULAR)) { + filename = g_build_filename(path, file, "xfce-notify-4.0", "gtkrc", NULL); + if(g_file_test(filename, G_FILE_TEST_IS_REGULAR)) { GtkTreeIter iter; gtk_list_store_append(ls, &iter); @@ -155,6 +154,7 @@ list_store_add_themes_in_dir(GtkListStore *ls, if(!strcmp(file, current_theme)) memcpy(current_theme_iter, &iter, sizeof(iter)); } + g_free(filename); } g_dir_close(dir);