From 7bc2f8c0fb6b963b52fe86d1259ae254f40362c5 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 9 Aug 2010 20:25:49 +0200 Subject: [PATCH] Avoid compiler warnings --- src/ui/gui/psppire-syntax-window.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index 7c70cbcb..436830c3 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -111,13 +111,10 @@ psppire_syntax_window_class_init (PsppireSyntaxWindowClass *class) GtkSourceLanguageManager *lm = gtk_source_language_manager_get_default (); const gchar * const *existing_paths = gtk_source_language_manager_get_search_path (lm); + gchar **new_paths = g_strdupv ((gchar **)existing_paths); + int n = g_strv_length ((gchar **) existing_paths); - const gchar **new_paths = g_strdupv (existing_paths); - - int n = g_strv_length (existing_paths); - - new_paths = g_realloc (new_paths, (n+1) * sizeof (*new_paths)); - + new_paths = g_realloc (new_paths, (n + 1) * sizeof (*new_paths)); new_paths[n] = g_strdup (relocate (PKGDATADIR)); new_paths[n+1] = NULL; @@ -130,6 +127,8 @@ psppire_syntax_window_class_init (PsppireSyntaxWindowClass *class) g_warning ("pspp.lang file not found. Syntax highlighting will not be available."); parent_class = g_type_class_peek_parent (class); + + g_strfreev (new_paths); } -- 2.30.2