diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-19 19:04:33 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-19 19:04:33 +0000 |
commit | 664200e644b45e52c70affa1c036d7366474ae9d (patch) | |
tree | d05be80055dae5be865e2a56c14d7f6d0ad0fa06 /src/core/stdfile | |
parent | 857add6ec30c59d98482c21c60e13f8c3adb89e9 (diff) |
core *printf patch
git-svn-id: http://svn.miranda-ng.org/main/trunk@5750 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/stdfile')
-rw-r--r-- | src/core/stdfile/filexferdlg.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/stdfile/filexferdlg.cpp b/src/core/stdfile/filexferdlg.cpp index 593008551e..bb69fdd495 100644 --- a/src/core/stdfile/filexferdlg.cpp +++ b/src/core/stdfile/filexferdlg.cpp @@ -493,9 +493,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if ((pszFilename = _tcsrchr(szOriginalFilename, '\\')) == NULL) pszFilename = szOriginalFilename;
if ((pszExtension = _tcsrchr(pszFilename+1, '.')) == NULL) pszExtension = pszFilename+lstrlen(pszFilename);
if (pfr->szFilename) mir_free((TCHAR*)pfr->szFilename);
- pfr->szFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*((pszExtension-szOriginalFilename)+21+lstrlen(pszExtension)));
+ size_t size = (pszExtension-szOriginalFilename)+21+lstrlen(pszExtension);
+ pfr->szFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*size);
for (i = 1;;i++) {
- _stprintf((TCHAR*)pfr->szFilename, _T("%.*s (%u)%s"), pszExtension-szOriginalFilename, szOriginalFilename, i, pszExtension);
+ mir_sntprintf((TCHAR*)pfr->szFilename, size, _T("%.*s (%u)%s"), pszExtension-szOriginalFilename, szOriginalFilename, i, pszExtension);
if (_taccess(pfr->szFilename, 0) != 0)
break;
}
|