summaryrefslogtreecommitdiff
path: root/display.c
diff options
context:
space:
mode:
authorandreas 'randy' weinberger <vdr@smue.org>2010-02-28 12:13:17 +0100
committerandreas 'randy' weinberger <vdr@smue.org>2010-02-28 12:13:17 +0100
commit4efb6e5dca657a4d04d2e995df762054df227a6e (patch)
tree11b64601d6bce46c293c0be0aa617befce90ca3c /display.c
parente73252dc58ecd5a27c6d8af94028f311f23687ab (diff)
downloadvdr-plugin-graphlcd-4efb6e5dca657a4d04d2e995df762054df227a6e.tar.gz
vdr-plugin-graphlcd-4efb6e5dca657a4d04d2e995df762054df227a6e.tar.bz2
added UTF8 support (vdr-graphlcd-0.1.5-utf8_i18n.diff)
Diffstat (limited to 'display.c')
-rw-r--r--display.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/display.c b/display.c
index f82d317..82678a5 100644
--- a/display.c
+++ b/display.c
@@ -22,7 +22,6 @@
#include "display.h"
#include "global.h"
-#include "i18n.h"
#include "setup.h"
#include "state.h"
#include "strfct.h"
@@ -723,7 +722,7 @@ void cGraphLCDDisplay::Update()
void cGraphLCDDisplay::DisplayTime()
{
static char buffer[32];
- static char month[5];
+ static char month[16];
int FrameWidth, TextLen, yPos;
struct tm tm_r;
@@ -758,8 +757,9 @@ void cGraphLCDDisplay::DisplayTime()
time(&CurrTime);
tm * tm = localtime_r(&CurrTime, &tm_r);
- strncpy(month, (char *)(tr("JanFebMarAprMayJunJulAugSepOctNovDec") + 3 * tm->tm_mon), 3);
- month[3] = 0;
+ const char *amonth = tr("JanFebMarAprMayJunJulAugSepOctNovDec");
+ amonth += Utf8SymChars(amonth, tm->tm_mon * 3);
+ strn0cpy(month, amonth, min(Utf8SymChars(amonth, 3) + 1, int(sizeof(month))));
snprintf(buffer, sizeof(buffer), "%s %2d.%s %d:%02d", (const char *) WeekDayName(tm->tm_wday), tm->tm_mday, month, tm->tm_hour, tm->tm_min);
TextLen = normalFont->Width(buffer);