From 8c18d579ef6457435562fe88051eb0c93f86cd17 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 27 Oct 2002 16:02:27 +0100 Subject: [PATCH] Fixed a crash when learning the keys of several remote controls --- CONTRIBUTORS | 2 ++ HISTORY | 3 +++ interface.c | 14 +++++++------- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 6df0e93b..7b75ac85 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -424,6 +424,8 @@ Oliver Endriss for adding some satellites to 'sources.conf' for reporting a bug in learning remote control keys in case there is more than one remote control + for reporting a crash when learning the keys of several remote controls and + pressing buttons of those that have already been learned Reinhard Walter Buchner for adding some satellites to 'sources.conf' diff --git a/HISTORY b/HISTORY index f53d55ea..536ea289 100644 --- a/HISTORY +++ b/HISTORY @@ -1667,3 +1667,6 @@ Video Disk Recorder Revision History the color buttons in normal viewing mode, as well as to up to 9 user defined keys. See MANUAL and man vdr(5) for more information. The default 'keymacros.conf' implements the functionality of the "color button patch". +- Fixed a crash when learning the keys of several remote controls and pressing + buttons of those that have already been learned (thanks to Oliver Endriss for + reporting this one). diff --git a/interface.c b/interface.c index 0f4b6151..a9f0d9a9 100644 --- a/interface.c +++ b/interface.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: interface.c 1.58 2002/10/26 12:22:18 kls Exp $ + * $Id: interface.c 1.59 2002/10/27 15:54:05 kls Exp $ */ #include "interface.h" @@ -352,12 +352,12 @@ void cInterface::QueryKeys(cRemote *Remote) char *NewCode = NULL; eKeys Key = cRemote::Get(100, &NewCode); switch (Key) { - case kUp: { - NewKey = eKeys(NewKey - 1); - cKey *last = Keys.Last(); - if (last && last->Key() == NewKey) - Keys.Del(last); - } + case kUp: if (NewKey > kUp) { + NewKey = eKeys(NewKey - 1); + cKey *last = Keys.Last(); + if (last && last->Key() == NewKey) + Keys.Del(last); + } break; case kDown: WriteText(1, 5, tr("Press 'Up' to confirm")); WriteText(1, 6, tr("Press 'Down' to continue"));