From fa38c0bf4a5fec438cd5d614c69b444e01cc1e3e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 4 Sep 2018 18:54:25 +0300 Subject: old ugly C-like calls replaced with CMStringA --- plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp') diff --git a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp index 3d24f10054..c0e9978259 100644 --- a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp @@ -38,14 +38,12 @@ CSendHTTPServer::CSendHTTPServer(HWND Owner, MCONTACT hContact, bool /*bAsync*/) m_EnableItem = SS_DLG_DESCRIPTION; //| SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND; m_pszSendTyp = LPGENW("HTTPServer transfer"); m_pszFileName = nullptr; - m_fsi_pszSrvPath = nullptr; m_fsi_pszRealPath = nullptr; } CSendHTTPServer::~CSendHTTPServer() { mir_free(m_pszFileName); - mir_free(m_fsi_pszSrvPath); mir_free(m_fsi_pszRealPath); } @@ -63,15 +61,15 @@ int CSendHTTPServer::Send() if (!m_pszFileName) { m_pszFileName = GetFileNameA(m_pszFile); } - mir_freeAndNil(m_fsi_pszSrvPath); - mir_stradd(m_fsi_pszSrvPath, "/"); - mir_stradd(m_fsi_pszSrvPath, m_pszFileName); + + m_fsi_pszSrvPath.Empty(); + m_fsi_pszSrvPath.AppendChar('/'); + m_fsi_pszSrvPath.Append(m_pszFileName); replaceStr(m_fsi_pszRealPath, _T2A(m_pszFile)); memset(&m_fsi, 0, sizeof(m_fsi)); m_fsi.lStructSize = sizeof(STFileShareInfo); - m_fsi.pszSrvPath = m_fsi_pszSrvPath; m_fsi.nMaxDownloads = -1; // -1 = infinite m_fsi.pszRealPath = m_fsi_pszRealPath; @@ -88,8 +86,7 @@ void CSendHTTPServer::SendThread() //patched plugin version ret = CallService(MS_HTTP_ADD_CHANGE_REMOVE, (WPARAM)m_hContact, (LPARAM)&m_fsi); if (!ret) { - mir_free(m_URL); - m_URL = (char*)CallService(MS_HTTP_GET_LINK, (WPARAM)m_fsi.pszSrvPath, NULL); + m_URL = ptrA((char*)CallService(MS_HTTP_GET_LINK, (WPARAM)m_fsi.pszSrvPath, 0)); } } else { -- cgit v1.2.3