summaryrefslogtreecommitdiff
path: root/plugins/FTPFileYM/src/job_upload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/FTPFileYM/src/job_upload.cpp')
-rw-r--r--plugins/FTPFileYM/src/job_upload.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp
index ba88b9c48d..04eca7a490 100644
--- a/plugins/FTPFileYM/src/job_upload.cpp
+++ b/plugins/FTPFileYM/src/job_upload.cpp
@@ -238,18 +238,16 @@ bool UploadJob::fileExistsOnServer()
/////////////////////////////////////////////////////////////////////////////////////////
-const wchar_t from_chars[] = L"абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ !@#$%^&=,{}[];'`";
-const wchar_t to_chars[] = L"abvgdeezziiklmnoprstufhccwwqyqeuaABVGDEEZZIIKLMNOPRSTUFHCCWWQYQEUA_________________";
+const wchar_t from_chars[] = L" !@#$%^&=,{}[];'`";
void UploadJob::makeSafeString(const wchar_t *input)
{
CMStringW tmp(input);
- size_t len = mir_wstrlen(from_chars);
- for (size_t i = 0; i < len; i++)
- tmp.Replace(from_chars[i], to_chars[i]);
+ for (size_t i = 0; i < _countof(from_chars)-1; i++)
+ tmp.Replace(from_chars[i], '_');
- strncpy(this->m_szSafeFileName, _T2A(tmp), _TRUNCATE);
+ strncpy_s(m_szSafeFileName, T2Utf(tmp), _TRUNCATE);
}
/////////////////////////////////////////////////////////////////////////////////////////