summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann Friedrichs <johann.friedrichs@web.de>2019-04-11 14:13:08 +0200
committerJohann Friedrichs <johann.friedrichs@web.de>2019-04-11 14:13:08 +0200
commit770de32f1908b1f9c60f66bf288a4c8a03f97d52 (patch)
treeb4c85632d0bdde12e6a75f92b61d10ea942a2a14
parentb9fa4f6bb61ccd58c94a7c0a222fd91bea4b5341 (diff)
downloadvdr-plugin-epgsearch-770de32f1908b1f9c60f66bf288a4c8a03f97d52.tar.gz
vdr-plugin-epgsearch-770de32f1908b1f9c60f66bf288a4c8a03f97d52.tar.bz2
Fix possible format overflow and avoid compiler warning
-rw-r--r--menu_conflictcheck.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/menu_conflictcheck.c b/menu_conflictcheck.c
index 3e03cfe..01340f8 100644
--- a/menu_conflictcheck.c
+++ b/menu_conflictcheck.c
@@ -164,10 +164,10 @@ bool cMenuConflictCheckDetailsItem::Update(bool Force)
hasTimer = timerObj->OrigTimer(Timers) ? timerObj->OrigTimer(Timers)->HasFlags(tfActive) : false;
if (Force || hasTimer != oldhasTimer) {
const cTimer* timer = timerObj->timer;
- char device[2] = "";
+ char device[3] = ""; // compiler warns if MAXDEVICES too big
if (hasTimer) {
if (!timerObj->conflCheckTime && timerObj->device > -1)
- sprintf(device, "%d", timerObj->device + 1);
+ sprintf(device, "%d", (timerObj->device + 1)&MAXDEVICES);
else {
if (timer->Local())
strcpy(device, tr("C"));
@@ -176,7 +176,6 @@ bool cMenuConflictCheckDetailsItem::Update(bool Force)
}
}
-// cString buffer = cString::sprintf("%s\t%s\t%d\t%s - %s\t%d\t%s\t%s", hasTimer?">":"", timer->Remote()?timer->Remote():"", timer->Channel()->Number(), TIMESTRING(timerObj->start), TIMESTRING(timerObj->stop), timer->Priority(), device, timer->File());
cString buffer = cString::sprintf("%s\t%d\t%s - %s\t%d\t%s\t%s", hasTimer ? ">" : "", timer->Channel()->Number(), TIMESTRING(timerObj->start), TIMESTRING(timerObj->stop), timer->Priority(), device, timer->File());
SetText(buffer);