summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--channels.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index 38f8632a..965d509b 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2630,3 +2630,4 @@ Video Disk Recorder Revision History
2004-01-25: Version 1.3.4
- Fixed handling language codes in case there is no audio or Dolby PID.
+- Fixed handling CA ids (was broken in 1.3.4).
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();
}