From 664200e644b45e52c70affa1c036d7366474ae9d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 19 Aug 2013 19:04:33 +0000 Subject: core *printf patch git-svn-id: http://svn.miranda-ng.org/main/trunk@5750 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/utils/openurl.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/modules/utils/openurl.cpp') 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); } } -- cgit v1.2.3