From 55b720e5ab69eeea2cde12866a1ee7700d773bb2 Mon Sep 17 00:00:00 2001 From: rbuj Date: Fri, 1 Jan 2021 21:35:57 +0100 Subject: Remove the cppcheck warning about the variable scope can be reduced --- libmenu/matemenu-tree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmenu/matemenu-tree.c b/libmenu/matemenu-tree.c index 6ab6526..0ee7502 100644 --- a/libmenu/matemenu-tree.c +++ b/libmenu/matemenu-tree.c @@ -653,8 +653,6 @@ load_object (char *id, char *object_path; GSettings *settings; char *location; - char **str; - char *desktop_name; object_path = g_strdup_printf ("/org/mate/panel/objects/%s/", id); settings = g_settings_new_with_path ("org.mate.panel.object", object_path); @@ -668,6 +666,9 @@ load_object (char *id, basename = g_path_get_basename (location); if (strstr (basename, "-1.") != NULL ) { + char **str; + char *desktop_name; + str = g_strsplit (basename, "-1.", -1); desktop_name = g_strdup_printf ("%s.%s", str[0], str[1]); g_ptr_array_add (self->collection_applet, desktop_name); -- cgit v1.2.1