[glib: 5/11] Fix redefinition of local variable and non-initialized variable in gio/gresource.c




commit 98c1b8461743f263bfe8f23e3ce6e1bc4faa8901
Author: Loic Le Page <llepage fluendo com>
Date:   Wed Jan 19 18:49:56 2022 +0100

    Fix redefinition of local variable and non-initialized variable in gio/gresource.c

 gio/gresource.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/gresource.c b/gio/gresource.c
index 53933f9d2..45ca92b1f 100644
--- a/gio/gresource.c
+++ b/gio/gresource.c
@@ -346,7 +346,7 @@ g_resource_find_overlay (const gchar    *path,
       if (envvar != NULL)
         {
           gchar **parts;
-          gint i, j;
+          gint j;
 
           parts = g_strsplit (envvar, G_SEARCHPATH_SEPARATOR_S, 0);
 
@@ -414,7 +414,7 @@ g_resource_find_overlay (const gchar    *path,
           /* We go out of the way to avoid malloc() in the normal case
            * where the environment variable is not set.
            */
-          static const gchar * const empty_strv[0 + 1];
+          static const gchar *const empty_strv[0 + 1] = { 0 };
           result = empty_strv;
         }
 


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