[gtk+] gtkthemingengine: Fix a definite use of an uninitialised variable



commit 5c5390f74b73d499dd27bac2d93c8b7b6fe35291
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Wed Nov 20 17:35:04 2013 +0000

    gtkthemingengine: Fix a definite use of an uninitialised variable
    
    At this point, segments[1] is always uninitialised, and is used to
    initialise itself. Looking at the code in the branch above, this appears
    to have been a typo from segments[0], as segments[1] seems to typically
    be 2 * segments[0].
    
    Found by scan-build.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712760

 gtk/gtkthemingengine.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index 18f7f74..775fd6b 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -1478,7 +1478,7 @@ set_stroke_style (cairo_t        *cr,
           n = round ((1. / 3) * n);
 
           segments[0] = n ? (1. / 3) * length / n : 1;
-          segments[1] = 2 * segments[1];
+          segments[1] = 2 * segments[0];
         }
       cairo_set_dash (cr, segments, G_N_ELEMENTS (segments), 0);
 


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