From 19e6db7997106bb2485b3982fb625ed964e19b3c Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 3 Apr 2013 00:35:27 +0200 Subject: [PATCH] gtksizegroup: Add explicit braces to avoid dangling else Otherwise the else after the for loop becomes attached to the wrong if. --- gtk/gtksizegroup.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c index e31dfa84eb..f84ed47f48 100644 --- a/gtk/gtksizegroup.c +++ b/gtk/gtksizegroup.c @@ -667,15 +667,22 @@ size_group_start_element (GMarkupParseContext *context, GSListSubParserData *data = (GSListSubParserData*)user_data; if (strcmp (element_name, "widget") == 0) - for (i = 0; names[i]; i++) - if (strcmp (names[i], "name") == 0) - data->items = g_slist_prepend (data->items, g_strdup (values[i])); + { + for (i = 0; names[i]; i++) + { + if (strcmp (names[i], "name") == 0) + data->items = g_slist_prepend (data->items, g_strdup (values[i])); + } + } else if (strcmp (element_name, "widgets") == 0) - return; + { + return; + } else - g_warning ("Unsupported type tag for GtkSizeGroup: %s\n", - element_name); - + { + g_warning ("Unsupported type tag for GtkSizeGroup: %s\n", + element_name); + } } static const GMarkupParser size_group_parser =