[gnome-builder] gstyle: fix uninitialised vars in palette test



commit 86a4bd3d678b69fe2d389ee994cef6b480017c59
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Sun Jan 15 14:40:31 2017 +0100

    gstyle: fix uninitialised vars in palette test

 contrib/gstyle/tests/test-gstyle-palette.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/contrib/gstyle/tests/test-gstyle-palette.c b/contrib/gstyle/tests/test-gstyle-palette.c
index bdf93b5..c6ec62a 100644
--- a/contrib/gstyle/tests/test-gstyle-palette.c
+++ b/contrib/gstyle/tests/test-gstyle-palette.c
@@ -37,14 +37,16 @@ load_palette (gchar *name)
   palette = gstyle_palette_new_from_file (file, cancellable, &error);
   if (palette == NULL)
     printf ("error: %s\n", error->message);
+  else
+    {
+      uri = g_file_get_uri (file);
 
-  uri = g_file_get_uri (file);
-
-  printf ("Palette:\n\turi:'%s'\n\tname:'%s'\n\tid:'%s'\n\tnb colors:%i\n",
-          uri,
-          gstyle_palette_get_name (palette),
-          gstyle_palette_get_id (palette),
-          gstyle_palette_get_len (palette));
+      printf ("Palette:\n\turi:'%s'\n\tname:'%s'\n\tid:'%s'\n\tnb colors:%i\n",
+              uri,
+              gstyle_palette_get_name (palette),
+              gstyle_palette_get_id (palette),
+              gstyle_palette_get_len (palette));
+    }
 
   return palette;
 }


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