1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed some warnings from g++ 7.2.0 regarding fixed buffer sizes

This commit is contained in:
Klaus Schmidinger 2018-03-23 15:47:26 +01:00
parent b539134e54
commit 1f16ada70c
4 changed files with 12 additions and 13 deletions

View File

@ -2630,6 +2630,8 @@ J
for reporting a possible deadlock when quickly zapping through encrypted channels for reporting a possible deadlock when quickly zapping through encrypted channels
for a patch that was used to implement cStatus::MarksModified() for a patch that was used to implement cStatus::MarksModified()
for suggesting to no longer log unaligned marks in cMarks::Align() for suggesting to no longer log unaligned marks in cMarks::Align()
for reporting some warnings from g++ 7.2.0 regarding fixed buffer sizes in
cMenuEditTimeItem::Set() and cCountdown::Update()
Peter Pinnau <vdr@unterbrecher.de> Peter Pinnau <vdr@unterbrecher.de>
for reporting that 'uint32_t' requires including stdint.h in font.h on some systems for reporting that 'uint32_t' requires including stdint.h in font.h on some systems

View File

@ -9317,10 +9317,12 @@ Video Disk Recorder Revision History
- Modified cMenuTimers::Delete() to avoid a lengthy lock on the Timers list while prompting - Modified cMenuTimers::Delete() to avoid a lengthy lock on the Timers list while prompting
the user. the user.
2018-03-19: Version 2.4.0 2018-03-23: Version 2.4.0
- Updated the Ukrainian OSD texts (thanks to Yarema Aka Knedlyk). - Updated the Ukrainian OSD texts (thanks to Yarema Aka Knedlyk).
- Fixed processing SVDRP client responses in case the caller doesn't want the actual - Fixed processing SVDRP client responses in case the caller doesn't want the actual
response strings (reported by Johann Friedrichs). response strings (reported by Johann Friedrichs).
- Fixed (not) saving the 'cam.data' file in case VDR stops early during startup due to - Fixed (not) saving the 'cam.data' file in case VDR stops early during startup due to
some error. some error.
- Fixed some warnings from g++ 7.2.0 regarding fixed buffer sizes in cMenuEditTimeItem::Set()
and cCountdown::Update() (reported by Jörg Wendel).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menuitems.c 4.2 2015/09/08 10:25:23 kls Exp $ * $Id: menuitems.c 4.3 2018/03/23 15:37:02 kls Exp $
*/ */
#include "menuitems.h" #include "menuitems.h"
@ -1062,14 +1062,12 @@ cMenuEditTimeItem::cMenuEditTimeItem(const char *Name, int *Value)
void cMenuEditTimeItem::Set(void) void cMenuEditTimeItem::Set(void)
{ {
char buf[10];
switch (pos) { switch (pos) {
case 1: snprintf(buf, sizeof(buf), "%01d-:--", hh / 10); break; case 1: SetValue(cString::sprintf("%01d-:--", hh / 10)); break;
case 2: snprintf(buf, sizeof(buf), "%02d:--", hh); break; case 2: SetValue(cString::sprintf("%02d:--", hh)); break;
case 3: snprintf(buf, sizeof(buf), "%02d:%01d-", hh, mm / 10); break; case 3: SetValue(cString::sprintf("%02d:%01d-", hh, mm / 10)); break;
default: snprintf(buf, sizeof(buf), "%02d:%02d", hh, mm); default: SetValue(cString::sprintf("%02d:%02d", hh, mm));
} }
SetValue(buf);
} }
eOSState cMenuEditTimeItem::ProcessKey(eKeys Key) eOSState cMenuEditTimeItem::ProcessKey(eKeys Key)

View File

@ -6,7 +6,7 @@
* *
* Original version written by Udo Richter <udo_richter@gmx.de>. * Original version written by Udo Richter <udo_richter@gmx.de>.
* *
* $Id: shutdown.c 4.1 2015/07/18 11:29:26 kls Exp $ * $Id: shutdown.c 4.2 2018/03/23 15:39:21 kls Exp $
*/ */
#include "shutdown.h" #include "shutdown.h"
@ -69,10 +69,7 @@ bool cCountdown::Update(void)
timedOut = true; timedOut = true;
if (counter != NewCounter) { if (counter != NewCounter) {
counter = NewCounter; counter = NewCounter;
char time[10]; Skins.Message(mtStatus, cString::sprintf(message, *cString::sprintf("%d:%d0", counter > 0 ? counter / 6 : 0, counter > 0 ? counter % 6 : 0)));
snprintf(time, sizeof(time), "%d:%d0", counter > 0 ? counter / 6 : 0, counter > 0 ? counter % 6 : 0);
cString Message = cString::sprintf(message, time);
Skins.Message(mtStatus, Message);
return true; return true;
} }
} }