From b87627e11f6845e2db24d60702ce681b5910742b Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 20 Dec 2011 11:08:38 +0100 Subject: Fix endless loop in slave_ctl_{prev,next}_ctl --- src/pa-sink-ctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pa-sink-ctl.c b/src/pa-sink-ctl.c index 181ccaa..4e17337 100644 --- a/src/pa-sink-ctl.c +++ b/src/pa-sink-ctl.c @@ -269,7 +269,7 @@ slave_ctl_prev_ctl(struct vol_ctl *ctl) if (el == NULL) return NULL; - while ((prev = el->prev)) { + for (prev = el->prev; prev; prev = prev->prev) { struct slave_ctl *t = prev->data; if (t->parent_index == sctl->parent_index) return &t->base; @@ -288,7 +288,7 @@ slave_ctl_next_ctl(struct vol_ctl *ctl) if (el == NULL) return NULL; - while ((next = el->next)) { + for (next = el->next; next; next = next->next) { struct slave_ctl *t = next->data; if (t->parent_index == sctl->parent_index) return &t->base; -- cgit