summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-08-15 15:39:23 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-09-01 15:40:21 +0200
commit6a61b5ed7ad47d7119e26bc914bddc08f38947dc (patch)
treec507e38b9378f5376f577a8264c7d7f17b7b6db7
parent9dc475aa0ffdbeac344c84588ae820789c255362 (diff)
downloadskin-lcarsng-6a61b5ed7ad47d7119e26bc914bddc08f38947dc.tar.gz
skin-lcarsng-6a61b5ed7ad47d7119e26bc914bddc08f38947dc.tar.bz2
Fixed a loop in cLCARSNGDisplayChannel::DrawTimer
-rw-r--r--displaychannel.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/displaychannel.c b/displaychannel.c
index 687f9e7..112750f 100644
--- a/displaychannel.c
+++ b/displaychannel.c
@@ -300,11 +300,18 @@ void cLCARSNGDisplayChannel::DrawEventRec(const cEvent *Present, const cEvent *F
void cLCARSNGDisplayChannel::DrawTimer(void)
{
+ int CountTimers = 0;
LOCK_TIMERS_READ;
+ for (const cTimer *Timer = Timers->First(); Timer; Timer = Timers->Next(Timer)) {
+ if (Timer->HasFlags(tfActive))
+ CountTimers++;
+ }
+ if (CountTimers == 0)
+ return;
cSortedTimers SortedTimers(Timers);
int i = 0;
int j = 0;
- while (i < 3) {
+ while (i < min(CountTimers, 3)) {
int y = yc05 + Margin + i * lineHeight + (i == 2 ? Margin : 0);
if (const cTimer *Timer = SortedTimers[i + j]) {
time_t Now = time(NULL);