[Xfce4-commits] <xfce4-settings:master> Dynamically allocate the filename (bug #7521).

Nick Schermer noreply at xfce.org
Thu Apr 21 17:40:01 CEST 2011


Updating branch refs/heads/master
         to 57ade33f4b612b03ba14692aef5a5b31d7e7fc1a (commit)
       from d1e93d2ccd8d87e5f8440ab1d0d22bb2aa401d4c (commit)

commit 57ade33f4b612b03ba14692aef5a5b31d7e7fc1a
Author: Yves-Alexis Perez <corsac at debian.org>
Date:   Thu Apr 21 16:47:11 2011 +0200

    Dynamically allocate the filename (bug #7521).
    
    PATH_MAX isn't available on hurd and not needed as well.

 .../xfce-settings-manager-dialog.c                 |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/xfce4-settings-manager/xfce-settings-manager-dialog.c b/xfce4-settings-manager/xfce-settings-manager-dialog.c
index 90d34c8..044e94a 100644
--- a/xfce4-settings-manager/xfce-settings-manager-dialog.c
+++ b/xfce4-settings-manager/xfce-settings-manager-dialog.c
@@ -384,7 +384,8 @@ xfce_settings_manager_dialog_sort_icons(GtkTreeModel *model,
 static void
 xfce_settings_manager_dialog_create_liststore(XfceSettingsManagerDialog *dialog)
 {
-    gchar **dirs, buf[PATH_MAX];
+    gchar **dirs;
+    gchar *filename;
     gint i, icon_size;
     GList *dialog_name_list = NULL;
 
@@ -424,8 +425,9 @@ xfce_settings_manager_dialog_create_liststore(XfceSettingsManagerDialog *dialog)
             if(!g_str_has_suffix(file, ".desktop"))
                 continue;
 
-            g_snprintf(buf, sizeof(buf), "%s/%s", dirs[i], file);
-            rcfile = xfce_rc_simple_open(buf, TRUE);
+            filename = g_build_filename(dirs[i], file, NULL);
+            rcfile = xfce_rc_simple_open(filename, TRUE);
+            g_free (filename);
             if(!rcfile)
                 continue;
 



More information about the Xfce4-commits mailing list