VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Language.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Language.c')
-rw-r--r--src/Common/Language.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Common/Language.c b/src/Common/Language.c
index 6dbd8b61..278b7dd1 100644
--- a/src/Common/Language.c
+++ b/src/Common/Language.c
@@ -209,6 +209,7 @@ static BOOL LoadLanguageData (int resourceid, BOOL bForceSetPreferredLanguage, B
LocalizationActive = FALSE;
ActiveLangPackVersion[0] = 0;
ClearDictionaryPool ();
+ LanguageResource = NULL;
if ((resourceid == 0) && (PreferredLangId[0] != 0))
StringCbCopyA (langId, sizeof(langId), PreferredLangId);
@@ -225,7 +226,7 @@ static BOOL LoadLanguageData (int resourceid, BOOL bForceSetPreferredLanguage, B
XmlGetAttributeText (xml, "prog-version", attr, sizeof (attr));
// Check version of external language file
- if (defaultLangParsed && strcmp (attr, VERSION_STRING VERSION_STRING_SUFFIX) && strcmp (attr, "DEBUG"))
+ if (defaultLangParsed && strcmp (attr, VERSION_STRING) && strcmp (attr, "DEBUG"))
{
wchar_t m[2048];
StringCbPrintfW (m, sizeof(m), L"The installed language pack is incompatible with this version of VeraCrypt (the language pack is for VeraCrypt %hs). A newer version may be available at www.idrix.fr.\n\nTo prevent this message from being displayed, do any of the following:\n\n- Select 'Settings' > 'Language'; then select 'English' and click 'OK'.\n\n- Remove or replace the language pack with a compatible version (the language pack may reside e.g. in 'C:\\Program Files\\VeraCrypt' or '%%LOCALAPPDATA%%\\VirtualStore\\Program Files\\VeraCrypt', etc.)", attr);
@@ -610,7 +611,8 @@ char *GetPreferredLangId ()
void SetPreferredLangId (char *langId)
{
- StringCbCopyA (PreferredLangId, sizeof(PreferredLangId), langId);
+ if (strlen(langId) < sizeof(PreferredLangId))
+ StringCbCopyA (PreferredLangId, sizeof(PreferredLangId), langId);
}