summaryrefslogtreecommitdiff
path: root/src/modules/utils
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-08-19 19:04:33 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-08-19 19:04:33 +0000
commit664200e644b45e52c70affa1c036d7366474ae9d (patch)
treed05be80055dae5be865e2a56c14d7f6d0ad0fa06 /src/modules/utils
parent857add6ec30c59d98482c21c60e13f8c3adb89e9 (diff)
core *printf patch
git-svn-id: http://svn.miranda-ng.org/main/trunk@5750 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/utils')
-rw-r--r--src/modules/utils/openurl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/modules/utils/openurl.cpp b/src/modules/utils/openurl.cpp
index 70590c8ebf..b451421441 100644
--- a/src/modules/utils/openurl.cpp
+++ b/src/modules/utils/openurl.cpp
@@ -37,9 +37,10 @@ static void OpenURLThread(void *arg)
return;
//wack a protocol on it
- TCHAR *szResult = (TCHAR*)mir_alloc(sizeof(TCHAR)*(lstrlen(hUrlInfo->szUrl)+9));
+ size_t size = lstrlen(hUrlInfo->szUrl)+9;
+ TCHAR *szResult = (TCHAR*)mir_alloc(sizeof(TCHAR)*size);
if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\') {
- wsprintf(szResult, _T("file:///%s"), hUrlInfo->szUrl);
+ mir_sntprintf(szResult, size, _T("file:///%s"), hUrlInfo->szUrl);
}
else {
int i;
@@ -48,9 +49,9 @@ static void OpenURLThread(void *arg)
szResult = mir_tstrdup(hUrlInfo->szUrl);
else {
if ( !_tcsnicmp(hUrlInfo->szUrl, _T("ftp."), 4))
- wsprintf(szResult, _T("ftp://%s"), hUrlInfo->szUrl);
+ mir_sntprintf(szResult, size, _T("ftp://%s"), hUrlInfo->szUrl);
else
- wsprintf(szResult, _T("http://%s"), hUrlInfo->szUrl);
+ mir_sntprintf(szResult, size, _T("http://%s"), hUrlInfo->szUrl);
}
}