From 7815821824c2f3a46d38ce9a69eb20f7a98d74f8 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Thu, 23 Jun 2016 15:36:51 +0300 Subject: [PATCH] Fix active device check. --- server.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server.c b/server.c index ae2de1d..62cb7d5 100644 --- a/server.c +++ b/server.c @@ -298,12 +298,12 @@ cSatipServer *cSatipServers::Find(int sourceP) cSatipServer *cSatipServers::Assign(int deviceIdP, int sourceP, int transponderP, int systemP) { - for (cSatipServer *s = First(); s && s->IsActive(); s = Next(s)) { - if (s->Matches(deviceIdP, sourceP, systemP, transponderP)) + for (cSatipServer *s = First(); s; s = Next(s)) { + if (s->IsActive() && s->Matches(deviceIdP, sourceP, systemP, transponderP)) return s; } - for (cSatipServer *s = First(); s && s->IsActive(); s = Next(s)) { - if (s->Assign(deviceIdP, sourceP, systemP, transponderP)) + for (cSatipServer *s = First(); s; s = Next(s)) { + if (s->IsActive() && s->Assign(deviceIdP, sourceP, systemP, transponderP)) return s; } return NULL;