From d10d7ce21c6fbce8b4a171091993b6344a21a6f3 Mon Sep 17 00:00:00 2001 From: Nikita Zlobin Date: Sat, 14 May 2011 15:14:48 +0600 Subject: [PATCH] Fix ports group search code --- src/gtkgraph-demo.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/gtkgraph-demo.c b/src/gtkgraph-demo.c index b0cbfd1..abe56d0 100644 --- a/src/gtkgraph-demo.c +++ b/src/gtkgraph-demo.c @@ -273,12 +273,16 @@ void g_modular_graph_module_add_port (GModularGraph_Port ** ret, if (module->ports) { GList * elem = module->ports; - while (elem->data) - if (G_MODULAR_GRAPH_PORTS_GROUP (elem->data)->direction == direction) - { - group = elem->data; - break; - } + while (1) + { + if (G_MODULAR_GRAPH_PORTS_GROUP (elem->data)->direction == direction) + { + group = elem->data; + break; + } + if (! elem->next) break; + elem = elem->next; + } } if (! group) { -- 2.11.4.GIT