From 1fe46dfa9faf971fee27870a49f652485e52647a Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 26 Mar 2006 09:27:30 +0200 Subject: Fixed format string handling --- menuitems.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'menuitems.c') 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 -- cgit v1.2.3