diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-08 12:49:22 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-08 12:49:22 +0300 |
commit | a41c3238e5dadf27751c5b0e50a5dbe6c52b3804 (patch) | |
tree | c8de5c81b91d1ef144ad442d9b2f8db94514c48c /plugins/FTPFileYM/src | |
parent | a818f6fad3c2e719dbf490b743a4b04d04a0bdb2 (diff) |
fixes #1832 (FTPFile: crash on filetransfer)
Diffstat (limited to 'plugins/FTPFileYM/src')
-rw-r--r-- | plugins/FTPFileYM/src/job_generic.h | 2 | ||||
-rw-r--r-- | plugins/FTPFileYM/src/job_upload.cpp | 10 | ||||
-rw-r--r-- | plugins/FTPFileYM/src/version.h | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/plugins/FTPFileYM/src/job_generic.h b/plugins/FTPFileYM/src/job_generic.h index b81c6e5f5e..f8ce9f36a9 100644 --- a/plugins/FTPFileYM/src/job_generic.h +++ b/plugins/FTPFileYM/src/job_generic.h @@ -71,7 +71,7 @@ public: ServerList::FTP *m_ftp;
wchar_t m_tszFilePath[1024];
wchar_t m_tszFileName[64];
- char m_szSafeFileName[64];
+ char m_szSafeFileName[256];
EMode m_mode;
EStatus m_status;
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);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/FTPFileYM/src/version.h b/plugins/FTPFileYM/src/version.h index 45859d8f11..9a2675aadf 100644 --- a/plugins/FTPFileYM/src/version.h +++ b/plugins/FTPFileYM/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 6
#define __RELEASE_NUM 0
-#define __BUILD_NUM 4
+#define __BUILD_NUM 5
#include <stdver.h>
|