diff options
author | Mataes <mataes2007@gmail.com> | 2018-03-17 21:41:50 +0300 |
---|---|---|
committer | Mataes <mataes2007@gmail.com> | 2018-03-17 21:41:50 +0300 |
commit | f632783f27da5dd0ed3513bbee6182ea8af30afe (patch) | |
tree | 9cc74d2944501221126e628404532aed8c7b5cd9 /plugins/FTPFileYM/src/job_upload.cpp | |
parent | 32ac77ea600fa6ae33fea77d2be8fdaec865da7b (diff) |
FTPFile: replace mir_strcpy and mir_wstrcpy
Diffstat (limited to 'plugins/FTPFileYM/src/job_upload.cpp')
-rw-r--r-- | plugins/FTPFileYM/src/job_upload.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp index a083225d57..f7edbebf25 100644 --- a/plugins/FTPFileYM/src/job_upload.cpp +++ b/plugins/FTPFileYM/src/job_upload.cpp @@ -36,7 +36,7 @@ UploadJob::UploadJob(UploadJob *job) : GenericJob(job),
m_fp(nullptr), m_uiSent(0), m_uiTotalSent(0), m_uiFileSize(0)
{
- mir_strcpy(m_szFileLink, job->m_szFileLink);
+ strncpy_s(m_szFileLink, job->m_szFileLink, _TRUNCATE);
for (int i = 0; i < _countof(m_lastSpeed); i++)
m_lastSpeed[i] = 0;
}
@@ -47,7 +47,10 @@ UploadJob::UploadJob(PackerJob *job) : for (int i = 0; i < _countof(m_lastSpeed); i++)
m_lastSpeed[i] = 0;
- Utils::makeSafeString(job->m_tszFileName, m_szSafeFileName);
+ CMStringA buf = _T2A(job->m_tszFileName);
+ Utils::makeSafeString(buf);
+ strncpy_s(m_szSafeFileName, buf.c_str(), _TRUNCATE);
+
m_status = STATUS_CREATED;
}
@@ -64,9 +67,12 @@ void UploadJob::addToUploadDlg() {
for (UINT i = 0; i < m_files.size(); i++) {
UploadJob *jobCopy = new UploadJob(this);
- mir_wstrcpy(jobCopy->m_tszFilePath, m_files[i]);
- mir_wstrcpy(jobCopy->m_tszFileName, Utils::getFileNameFromPath(jobCopy->m_tszFilePath));
- Utils::makeSafeString(jobCopy->m_tszFileName, jobCopy->m_szSafeFileName);
+ wcsncpy_s(jobCopy->m_tszFilePath, m_files[i], _TRUNCATE);
+ wcsncpy_s(jobCopy->m_tszFileName, Utils::getFileNameFromPath(jobCopy->m_tszFilePath), _TRUNCATE);
+
+ CMStringA buf = jobCopy->m_tszFileName;
+ Utils::makeSafeString(buf);
+ strncpy_s(jobCopy->m_szSafeFileName, buf.c_str(), _TRUNCATE);
UploadDialog::Tab *newTab = new UploadDialog::Tab(jobCopy);
jobCopy->m_tab = newTab;
@@ -290,7 +296,7 @@ void UploadJob::upload() if (fileExistsOnServer()) {
int res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DLG_FILEEXISTS), nullptr, DlgProcFileExists, (LPARAM)m_szSafeFileName);
if (res == IDC_RENAME) {
- if (Utils::setFileNameDlgA(m_szSafeFileName) == true)
+ if (Utils::setFileNameDlg(_A2T(m_szSafeFileName)) == true)
curl_easy_setopt(hCurl, CURLOPT_URL, getUrlString());
}
else if (res == IDC_COPYURL) {
|