VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-10-05 02:01:25 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-10-05 04:31:13 +0200
commit4682f9b235e23d7d673b07bb57da5c13ef133c2d (patch)
tree49026ac8923287214a0f78e993c047f22fec9a9a
parent185e4211143913c078e63f1990bbc6fa36adc1c9 (diff)
downloadVeraCrypt-4682f9b235e23d7d673b07bb57da5c13ef133c2d.tar.gz
VeraCrypt-4682f9b235e23d7d673b07bb57da5c13ef133c2d.zip
Windows: remove wrong check for return value of MultiByteToWideChar
-rw-r--r--src/Common/Language.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Common/Language.c b/src/Common/Language.c
index e6abd38d..dbad2d5e 100644
--- a/src/Common/Language.c
+++ b/src/Common/Language.c
@@ -299,7 +299,7 @@ BOOL LoadLanguageFile ()
// UTF8 => wide char
len = MultiByteToWideChar (CP_UTF8, 0, attr, -1, wattr, sizeof (wattr) / sizeof(wattr[0]));
- if (len == 0 || len == ERROR_NO_UNICODE_TRANSLATION)
+ if (len == 0)
{
MessageBox (0, key, "VeraCrypt: Error while decoding UTF-8 string", MB_ICONERROR);
return FALSE;
@@ -408,7 +408,7 @@ BOOL CALLBACK LanguageDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
XmlGetAttributeText (xml, "name", attr, sizeof (attr));
len = MultiByteToWideChar (CP_UTF8, 0, attr, -1, wattr, sizeof (wattr) / sizeof(wattr[0]));
- if (len != 0 && len != ERROR_NO_UNICODE_TRANSLATION
+ if (len != 0
&& (!defaultLangFound || wcscmp (wattr, L"English") != 0))
{
int i = (int) SendDlgItemMessageW (hwndDlg, IDC_LANGLIST, LB_ADDSTRING, 0, (LPARAM)wattr);
@@ -448,7 +448,7 @@ BOOL CALLBACK LanguageDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
else
{
nLen = MultiByteToWideChar (CP_UTF8, 0, ActiveLangPackVersion, -1, wversion, sizeof (wversion) / sizeof(wversion[0]));
- if (nLen != 0 && nLen != ERROR_NO_UNICODE_TRANSLATION)
+ if (nLen != 0)
StringCbPrintfW (szVers, sizeof(szVers),GetString("LANG_PACK_VERSION"), wversion);
}
SetWindowTextW (GetDlgItem (hwndDlg, IDC_LANGPACK_VERSION), szVers);
@@ -456,7 +456,7 @@ BOOL CALLBACK LanguageDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
// Translator credits
XmlGetAttributeText (xml, "translators", credits, sizeof (credits));
nLen = MultiByteToWideChar (CP_UTF8, 0, credits, -1, wcredits, sizeof (wcredits) / sizeof(wcredits[0]));
- if (nLen != 0 && nLen != ERROR_NO_UNICODE_TRANSLATION)
+ if (nLen != 0)
{
SetWindowTextW (GetDlgItem (hwndDlg, IDC_LANGPACK_CREDITS), wcredits);
}