Support long key names for languages. (bug 6282)

This commit is contained in:
Asher Baker 2014-11-19 23:08:35 +00:00
parent f38fd6a550
commit ced026cecc
2 changed files with 9 additions and 1 deletions

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;

View File

@ -54,7 +54,7 @@ enum PhraseParseState
struct Language
{
char m_code2[4];
char m_code2[32];
int m_CanonicalName;
};