mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
Windows: remove wrong check for return value of MultiByteToWideChar
This commit is contained in:
@@ -299,7 +299,7 @@ BOOL LoadLanguageFile ()
|
|||||||
|
|
||||||
// UTF8 => wide char
|
// UTF8 => wide char
|
||||||
len = MultiByteToWideChar (CP_UTF8, 0, attr, -1, wattr, sizeof (wattr) / sizeof(wattr[0]));
|
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);
|
MessageBox (0, key, "VeraCrypt: Error while decoding UTF-8 string", MB_ICONERROR);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -408,7 +408,7 @@ BOOL CALLBACK LanguageDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
|
|||||||
XmlGetAttributeText (xml, "name", attr, sizeof (attr));
|
XmlGetAttributeText (xml, "name", attr, sizeof (attr));
|
||||||
len = MultiByteToWideChar (CP_UTF8, 0, attr, -1, wattr, sizeof (wattr) / sizeof(wattr[0]));
|
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))
|
&& (!defaultLangFound || wcscmp (wattr, L"English") != 0))
|
||||||
{
|
{
|
||||||
int i = (int) SendDlgItemMessageW (hwndDlg, IDC_LANGLIST, LB_ADDSTRING, 0, (LPARAM)wattr);
|
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
|
else
|
||||||
{
|
{
|
||||||
nLen = MultiByteToWideChar (CP_UTF8, 0, ActiveLangPackVersion, -1, wversion, sizeof (wversion) / sizeof(wversion[0]));
|
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);
|
StringCbPrintfW (szVers, sizeof(szVers),GetString("LANG_PACK_VERSION"), wversion);
|
||||||
}
|
}
|
||||||
SetWindowTextW (GetDlgItem (hwndDlg, IDC_LANGPACK_VERSION), szVers);
|
SetWindowTextW (GetDlgItem (hwndDlg, IDC_LANGPACK_VERSION), szVers);
|
||||||
@@ -456,7 +456,7 @@ BOOL CALLBACK LanguageDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
|
|||||||
// Translator credits
|
// Translator credits
|
||||||
XmlGetAttributeText (xml, "translators", credits, sizeof (credits));
|
XmlGetAttributeText (xml, "translators", credits, sizeof (credits));
|
||||||
nLen = MultiByteToWideChar (CP_UTF8, 0, credits, -1, wcredits, sizeof (wcredits) / sizeof(wcredits[0]));
|
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);
|
SetWindowTextW (GetDlgItem (hwndDlg, IDC_LANGPACK_CREDITS), wcredits);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user