From 5cfd39dfca50a8585e7fa9a729e996bbcfac78e7 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 6 Aug 2011 10:45:05 +0200 Subject: [PATCH] Fixed handling DiSEqC codes --- CONTRIBUTORS | 4 ++++ HISTORY | 2 ++ diseqc.c | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index e3a4a5cd..8978e676 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1700,6 +1700,7 @@ Udo Richter "TITLE" or "EPISODE" for a patch to "Made updating the editing marks during replay react faster in case the marks file has just been written" + for suggesting a fix for a bug in handling DiSEqC codes Sven Kreiensen for his help in keeping 'channels.conf.terr' up to date @@ -2740,3 +2741,6 @@ Jonas Diemer Jerome Lacarriere for increasing MAXCAIDS to 12 + +Mark Hawes + for reporting a bug in handling DiSEqC codes diff --git a/HISTORY b/HISTORY index 5eef4958..98639854 100644 --- a/HISTORY +++ b/HISTORY @@ -6662,3 +6662,5 @@ Video Disk Recorder Revision History - Fixed the return value of the svdrpsend.pl script in case of an error (thanks to Jonas Diemer). - Increased MAXCAIDS to 12 (thanks to Jerome Lacarriere). +- Fixed handling DiSEqC codes (thanks to Mark Hawes for reporting the bug, and + Udo Richter for suggesting the fix). diff --git a/diseqc.c b/diseqc.c index b65d82c6..d4462997 100644 --- a/diseqc.c +++ b/diseqc.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: diseqc.c 2.4 2011/05/22 10:36:12 kls Exp $ + * $Id: diseqc.c 2.5 2011/08/06 10:32:18 kls Exp $ */ #include "diseqc.h" @@ -95,13 +95,13 @@ const char *cDiseqc::Codes(const char *s) const if (e) { int NumCodes = 0; const char *t = s; - char *p; while (t < e) { if (NumCodes < MaxDiseqcCodes) { errno = 0; + char *p; int n = strtol(t, &p, 16); if (!errno && p != t && 0 <= n && n <= 255) { - if (parsing) { + if (!parsing) { codes[NumCodes++] = uchar(n); numCodes = NumCodes; }