Merge pull request #208 from asherkin/long-lang-codes

Support long key names for languages (bug 6282)
This commit is contained in:
Asher Baker 2014-11-24 19:07:18 +00:00
commit 50898d7a4f
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;
};