1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

fix Program freeze Volume Creation Wizard linux (#726)

This commit is contained in:
T-Bonhagen
2021-02-21 10:16:24 +01:00
committed by GitHub
parent c802db448d
commit 874d29390f
2 changed files with 12 additions and 3 deletions

View File

@@ -51,7 +51,6 @@ namespace VeraCrypt
{ {
wxString text = node.InnerText; wxString text = node.InnerText;
text.Replace (L"\\n", L"\n"); text.Replace (L"\\n", L"\n");
text.Replace (L"%s", L"{0}");
Map[StringConverter::ToSingle (wstring (node.Attributes[L"key"]))] = text; Map[StringConverter::ToSingle (wstring (node.Attributes[L"key"]))] = text;
} }
#endif #endif
@@ -59,7 +58,6 @@ namespace VeraCrypt
{ {
wxString text = node.InnerText; wxString text = node.InnerText;
text.Replace (L"\\n", L"\n"); text.Replace (L"\\n", L"\n");
text.Replace (L"%s", L"{0}");
Map[StringConverter::ToSingle (wstring (node.Attributes[L"key"]))] = text; Map[StringConverter::ToSingle (wstring (node.Attributes[L"key"]))] = text;
} }
} }

View File

@@ -20,7 +20,18 @@ namespace VeraCrypt
{ {
bool numberExpected = false; bool numberExpected = false;
bool endTagExpected = false; bool endTagExpected = false;
foreach (wchar_t c, wstring (format))
//TODO replace this workaround for %s, %d, %c for printf
wxString text(format);
text.Replace (L"%s", L"{}",true);
text.Replace (L"%d", L"{}",true);
text.Replace (L"%c", L"{}",true);
int i=0;
while (text.find(L"{}") != (size_t) wxNOT_FOUND){
text.Replace(L"{}",L"{"+wxString::Format(wxT("%i"),i++)+L"}",false);
}
foreach (wchar_t c, wstring (text))
{ {
if (numberExpected) if (numberExpected)
{ {