VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/StringFormatter.cpp
diff options
context:
space:
mode:
authorT-Bonhagen <75760084+T-Bonhagen@users.noreply.github.com>2021-02-21 10:16:24 +0100
committerGitHub <noreply@github.com>2021-02-21 10:16:24 +0100
commit874d29390f6db64b045b7952cc0331e40f25d325 (patch)
tree0a0bc3e86cc6cdbcd215a20f6924d011001162c7 /src/Main/StringFormatter.cpp
parentc802db448de591a45144fc7300a10b2c9392ce30 (diff)
downloadVeraCrypt-874d29390f6db64b045b7952cc0331e40f25d325.tar.gz
VeraCrypt-874d29390f6db64b045b7952cc0331e40f25d325.zip
fix Program freeze Volume Creation Wizard linux (#726)
Diffstat (limited to 'src/Main/StringFormatter.cpp')
-rw-r--r--src/Main/StringFormatter.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Main/StringFormatter.cpp b/src/Main/StringFormatter.cpp
index 4f8c2cc6..e64f85c3 100644
--- a/src/Main/StringFormatter.cpp
+++ b/src/Main/StringFormatter.cpp
@@ -20,7 +20,18 @@ namespace VeraCrypt
{
bool numberExpected = 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)
{