mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Changed the 'languageCode' members in the descriptor classes of 'libsi' to 'char[4]' and setting the 4th byte to 0 for easier handling
This commit is contained in:
11
i18n.c
11
i18n.c
@@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: i18n.c 1.144 2004/01/24 10:02:37 kls Exp $
|
||||
* $Id: i18n.c 1.145 2004/01/24 14:58:08 kls Exp $
|
||||
*
|
||||
* Translations provided by:
|
||||
*
|
||||
@@ -4238,16 +4238,13 @@ const char * I18nLanguageAbbreviation(int Index)
|
||||
return Index < I18nNumLanguages ? Phrases[2][Index] : NULL;
|
||||
}
|
||||
|
||||
int I18nLanguageIndex(const char Code[3])
|
||||
int I18nLanguageIndex(const char *Code)
|
||||
{
|
||||
char s[4];
|
||||
memcpy(s, Code, 3);
|
||||
s[3] = 0;
|
||||
for (int i = 0; i < I18nNumLanguages; i++) {
|
||||
if (strcasestr(Phrases[2][i], s))
|
||||
if (strcasestr(Phrases[2][i], Code))
|
||||
return i;
|
||||
}
|
||||
//dsyslog("unknown language code: '%s'", s);
|
||||
//dsyslog("unknown language code: '%s'", Code);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user