Support long key names for languages. (bug 6282)

This commit is contained in:
Asher Baker
2014-11-22 22:18:49 +00:00
parent f38fd6a550
commit ced026cecc
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -887,6 +887,14 @@ SMCResult Translator::ReadSMC_LeavingSection(const SMCStates *states)
SMCResult Translator::ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value)
{
size_t len = strlen(key);
if (len >= sizeof(((Language *)0)->m_code2))
{
logger->LogError("[SM] Warning encountered parsing languages.cfg file.");
logger->LogError("[SM] Invalid language code \"%s\" is too long.", key);
}
AddLanguage(key, value);
return SMCResult_Continue;
+1 -1
View File
@@ -54,7 +54,7 @@ enum PhraseParseState
struct Language
{
char m_code2[4];
char m_code2[32];
int m_CanonicalName;
};