diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2009-08-29 13:53:42 +0200 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2009-08-29 13:53:42 +0200 |
commit | 6c8c62e93c543fd940169da519e6528c47e54717 (patch) | |
tree | 19e2dcfdff52e7892096cb3510d6c2681f4045ed /epgsearchext.c | |
parent | 41c2e71d91a2d42ba830ffce782dc7fd3e845560 (diff) | |
download | vdr-plugin-epgsearch-6c8c62e93c543fd940169da519e6528c47e54717.tar.gz vdr-plugin-epgsearch-6c8c62e93c543fd940169da519e6528c47e54717.tar.bz2 |
fix UTF8-character handling in timer filenames
Diffstat (limited to 'epgsearchext.c')
-rw-r--r-- | epgsearchext.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/epgsearchext.c b/epgsearchext.c index 32e9c40..37be75a 100644 --- a/epgsearchext.c +++ b/epgsearchext.c @@ -628,15 +628,16 @@ char* cSearchExt::BuildFile(const cEvent* pEvent) const return file; const char *Subtitle = pEvent ? pEvent->ShortText() : NULL; - char SubtitleBuffer[MAX_SUBTITLE_LENGTH]; + char SubtitleBuffer[Utf8BufSize(MAX_SUBTITLE_LENGTH)]; if (isempty(Subtitle)) { sprintf(SubtitleBuffer, "%s-%s", GETDATESTRING(pEvent), GETTIMESTRING(pEvent)); Subtitle = SubtitleBuffer; } - else if (strlen(Subtitle) > MAX_SUBTITLE_LENGTH) + else if (Utf8StrLen(Subtitle) > MAX_SUBTITLE_LENGTH) { - strn0cpy(SubtitleBuffer, Subtitle, MAX_SUBTITLE_LENGTH); + Utf8Strn0Cpy(SubtitleBuffer, Subtitle, sizeof(SubtitleBuffer)); + SubtitleBuffer[Utf8SymChars(SubtitleBuffer, MAX_SUBTITLE_LENGTH)] = 0; Subtitle = SubtitleBuffer; } |