From 1884b72ff3351dd1ce6d07f35af127507fd6a675 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 26 Jan 2004 16:28:35 +0100 Subject: Fixed handling CA ids (was broken in 1.3.4) --- channels.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'channels.c') diff --git a/channels.c b/channels.c index 2ae5bf44..4b3930d4 100644 --- a/channels.c +++ b/channels.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: channels.c 1.21 2004/01/25 16:02:13 kls Exp $ + * $Id: channels.c 1.22 2004/01/26 16:28:35 kls Exp $ */ #include "channels.h" @@ -322,6 +322,8 @@ static int IntArrayToString(char *s, const int *a, int Base = 10, const char n[] q += sprintf(q, Base == 16 ? "%s%X" : "%s%d", i ? "," : "", a[i]); if (a[i] && n && *n[i]) q += sprintf(q, "=%s", n[i]); + if (!a[i]) + break; i++; } *q = 0; @@ -375,8 +377,11 @@ void cChannel::SetCaIds(const int *CaIds) IntArrayToString(OldCaIdsBuf, caids, 16); IntArrayToString(NewCaIdsBuf, CaIds, 16); dsyslog("changing caids of channel %d from %s to %s", Number(), OldCaIdsBuf, NewCaIdsBuf); - for (int i = 0; i <= MAXCAIDS && CaIds[i]; i++) // <= to copy the terminating 0 + for (int i = 0; i <= MAXCAIDS; i++) { // <= to copy the terminating 0 caids[i] = CaIds[i]; + if (!CaIds[i]) + break; + } modification |= CHANNELMOD_CA; Channels.SetModified(); } -- cgit v1.2.3