From d9f23a8af20c53feb2a776490a58078127341932 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Wed, 28 Aug 2013 13:18:55 -0400 Subject: [PATCH] Fix translator system not loading languages with long identifier (bug 5888, r=dvander). --- core/logic/Translator.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/core/logic/Translator.cpp b/core/logic/Translator.cpp index c1507e9f..97369514 100644 --- a/core/logic/Translator.cpp +++ b/core/logic/Translator.cpp @@ -474,13 +474,6 @@ SMCResult CPhraseFile::ReadSMC_KeyValue(const SMCStates *states, const char *key } else { - size_t len = strlen(key); - if (len < 2 || len > 3) - { - ParseWarning("Ignoring translation to invalid language \"%s\" on line %d.", key, states->line); - return SMCResult_Continue; - } - unsigned int lang; if (!m_pTranslator->GetLanguageByCode(key, &lang)) { @@ -493,7 +486,7 @@ SMCResult CPhraseFile::ReadSMC_KeyValue(const SMCStates *states, const char *key /* See how many bytes we need for this string, then allocate. * NOTE: THIS SHOULD GUARANTEE THAT WE DO NOT NEED TO NEED TO SIZE CHECK */ - len = strlen(value) + pPhrase->fmt_bytes + 1; + size_t len = strlen(value) + pPhrase->fmt_bytes + 1; char *out_buf; int out_idx; @@ -894,14 +887,6 @@ 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 < 2 || len > 3) - { - smcore.LogError("[SM] Warning encountered parsing languages.cfg file."); - smcore.LogError("[SM] Invalid language code \"%s\" is being ignored.", key); - } - AddLanguage(key, value); return SMCResult_Continue;