[pango] Silence a few coverity warnings



commit ee36b26eddcbbc169660de188b4804e21194c530
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jul 17 20:36:47 2015 -0400

    Silence a few coverity warnings
    
    coverity says: Using uninitialized value "index2". It didn't
    notice that the only time we can reach the index = index2
    assignment with index2 still uninitialized is when we are
    never going to look at index again.

 tests/test-layout.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/tests/test-layout.c b/tests/test-layout.c
index 62333c1..75af21b 100644
--- a/tests/test-layout.c
+++ b/tests/test-layout.c
@@ -94,6 +94,7 @@ dump_lines (PangoLayout *layout, GString *string)
 
   has_more = TRUE;
   index = pango_layout_iter_get_index (iter);
+  index2 = 0;
   i = 0;
   while (has_more)
     {
@@ -132,13 +133,14 @@ dump_runs (PangoLayout *layout, GString *string)
   gboolean has_more;
   gchar *char_str;
   gint i;
-  gchar *font;
+  gchar *font = 0;
 
   text = pango_layout_get_text (layout);
   iter = pango_layout_get_iter (layout);
 
   has_more = TRUE;
   index = pango_layout_iter_get_index (iter);
+  index2 = 0;
   i = 0;
   while (has_more)
     {


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