summaryrefslogtreecommitdiffstats
path: root/libhb/lang.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-01-29 09:05:44 -0700
committerJohn Stebbins <[email protected]>2016-01-29 09:05:44 -0700
commitda7b1d29c60f740037883f44e07415580fc5d9a9 (patch)
tree9af15daec5e79d5173191823e655c27ba2e0e1b8 /libhb/lang.c
parent09afa66f873a456ae41b7149a5b741be34bfaec8 (diff)
libhb: fix use of uninitialized variable in lang.c
It caused crashes in some builds
Diffstat (limited to 'libhb/lang.c')
-rw-r--r--libhb/lang.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libhb/lang.c b/libhb/lang.c
index a8ed2e8c8..c51c80ad5 100644
--- a/libhb/lang.c
+++ b/libhb/lang.c
@@ -205,7 +205,7 @@ static const int lang_count = sizeof(languages) / sizeof(languages[0]);
const int lang_lookup_index( const char * str )
{
int ii = 0;
- iso639_lang_t * lang;
+ const iso639_lang_t * lang;
// We use "Any" as a synonym for undefined
if (!strcasecmp("any", str))
@@ -213,7 +213,7 @@ const int lang_lookup_index( const char * str )
return 0;
}
- for (ii = 0; lang->eng_name; ii++)
+ for (ii = 0; languages[ii].eng_name; ii++)
{
lang = &languages[ii];
if ((lang->iso639_1 != NULL && !strcasecmp(lang->iso639_1, str)) ||
@@ -234,7 +234,7 @@ const iso639_lang_t * lang_lookup( const char * str )
return lang_for_index(lang_lookup_index(str));
}
-iso639_lang_t * lang_for_index( int index )
+const iso639_lang_t * lang_for_index( int index )
{
if (index < 0 || index >= lang_count)
return NULL;