[glib] gsettingsschema: Fix a compiler warning



commit 5eededccda6236cd307b0f0bcc852e495e9fd8f8
Author: Daniel Boles <dboles src gnome org>
Date:   Wed Jul 12 19:23:40 2017 +0100

    gsettingsschema: Fix a compiler warning
    
    g_build_filename() returns a gchar*, but it was stored in a const gchar*
    and then g_free()d, which is wrong and led to a warning about the const
    qualifier being cast away.

 gio/gsettingsschema.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gio/gsettingsschema.c b/gio/gsettingsschema.c
index dc55864..bc7a4ac 100644
--- a/gio/gsettingsschema.c
+++ b/gio/gsettingsschema.c
@@ -324,7 +324,7 @@ try_prepend_dir (const gchar *directory)
 static void
 try_prepend_data_dir (const gchar *directory)
 {
-  const gchar *dirname = g_build_filename (directory, "glib-2.0", "schemas", NULL);
+  gchar *dirname = g_build_filename (directory, "glib-2.0", "schemas", NULL);
   try_prepend_dir (dirname);
   g_free (dirname);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]