summaryrefslogtreecommitdiff
path: root/menuitems.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2006-03-26 09:27:30 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2006-03-26 09:27:30 +0200
commit1fe46dfa9faf971fee27870a49f652485e52647a (patch)
treeb9ab0238825442c042a781ffd5c5d01462fe5f1c /menuitems.c
parent8a3dae1e8bc3c008abc425c026f1c1bdf1ce026d (diff)
downloadvdr-1fe46dfa9faf971fee27870a49f652485e52647a.tar.gz
vdr-1fe46dfa9faf971fee27870a49f652485e52647a.tar.bz2
Fixed format string handling
Diffstat (limited to 'menuitems.c')
-rw-r--r--menuitems.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/menuitems.c b/menuitems.c
index 7bd1605a..34e0dd75 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 1.33 2006/02/28 12:53:37 kls Exp $
+ * $Id: menuitems.c 1.34 2006/03/26 09:10:17 kls Exp $
*/
#include "menuitems.h"
@@ -290,12 +290,11 @@ void cMenuEditStrItem::AdvancePos(void)
void cMenuEditStrItem::Set(void)
{
char buf[1000];
- const char *fmt = insert && newchar ? "[]%c%s" : "[%c]%s";
if (InEditMode()) {
const cFont *font = cFont::GetFont(fontOsd);
strncpy(buf, value, pos);
- snprintf(buf + pos, sizeof(buf) - pos - 2, fmt, *(value + pos), value + pos + 1);
+ snprintf(buf + pos, sizeof(buf) - pos - 2, insert && newchar ? "[]%c%s" : "[%c]%s", *(value + pos), value + pos + 1);
int width = cSkinDisplay::Current()->EditableWidth();
if (font->Width(buf) <= width) {
// the whole buffer fits on the screen