summaryrefslogtreecommitdiff
path: root/menuitems.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2018-03-23 15:47:26 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2018-03-23 15:47:26 +0100
commit1f16ada70ccf96fc8b2bf2f7b18b4e62afa33e9e (patch)
treedd335dfa60b29b8d64ba04f89e58b596097eb2ee /menuitems.c
parentb539134e548ce6fb51c16a3407567066f76e261c (diff)
downloadvdr-1f16ada70ccf96fc8b2bf2f7b18b4e62afa33e9e.tar.gz
vdr-1f16ada70ccf96fc8b2bf2f7b18b4e62afa33e9e.tar.bz2
Fixed some warnings from g++ 7.2.0 regarding fixed buffer sizes
Diffstat (limited to 'menuitems.c')
-rw-r--r--menuitems.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/menuitems.c b/menuitems.c
index 659c1a58..d764c58c 100644
--- a/menuitems.c
+++ b/menuitems.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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"
@@ -1062,14 +1062,12 @@ cMenuEditTimeItem::cMenuEditTimeItem(const char *Name, int *Value)
void cMenuEditTimeItem::Set(void)
{
- char buf[10];
switch (pos) {
- case 1: snprintf(buf, sizeof(buf), "%01d-:--", hh / 10); break;
- case 2: snprintf(buf, sizeof(buf), "%02d:--", hh); break;
- case 3: snprintf(buf, sizeof(buf), "%02d:%01d-", hh, mm / 10); break;
- default: snprintf(buf, sizeof(buf), "%02d:%02d", hh, mm);
+ case 1: SetValue(cString::sprintf("%01d-:--", hh / 10)); break;
+ case 2: SetValue(cString::sprintf("%02d:--", hh)); break;
+ case 3: SetValue(cString::sprintf("%02d:%01d-", hh, mm / 10)); break;
+ default: SetValue(cString::sprintf("%02d:%02d", hh, mm));
}
- SetValue(buf);
}
eOSState cMenuEditTimeItem::ProcessKey(eKeys Key)