From 532062df96b3129ded3174d20fe71f0a007c4237 Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Fri, 5 Dec 2003 23:33:59 +0000 Subject: Applied patch from Ross McFarland , initialize *count_p Fri Dec 5 15:30:16 2003 Manish Singh * gtk/gtkaccelgroup.c (quick_accel_find): Applied patch from Ross McFarland , initialize *count_p to 0 before doing anything to prevent garbage returns. --- gtk/gtkaccelgroup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gtk/gtkaccelgroup.c') diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c index a327fd260..1f5d029a3 100644 --- a/gtk/gtkaccelgroup.c +++ b/gtk/gtkaccelgroup.c @@ -443,6 +443,8 @@ quick_accel_find (GtkAccelGroup *accel_group, GtkAccelGroupEntry *entry; GtkAccelGroupEntry key; + *count_p = 0; + if (!accel_group->n_accels) return NULL; @@ -460,7 +462,7 @@ quick_accel_find (GtkAccelGroup *accel_group, entry[-1].key.accel_mods != accel_mods) break; /* count equal members */ - for (*count_p = 0; entry + *count_p < accel_group->priv_accels + accel_group->n_accels; (*count_p)++) + for (; entry + *count_p < accel_group->priv_accels + accel_group->n_accels; (*count_p)++) if (entry[*count_p].key.accel_key != accel_key || entry[*count_p].key.accel_mods != accel_mods) break; -- cgit v1.2.1