diff options
-rw-r--r-- | plugins/SendScreenshotPlus/src/CSend.cpp | 57 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/CSend.h | 162 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp | 13 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/CSendHTTPServer.h | 4 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp | 19 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp | 14 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp | 2 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/mir_string.cpp | 66 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/mir_string.h | 35 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/stdafx.h | 1 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/version.h | 4 |
11 files changed, 120 insertions, 257 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index be31a7bfe0..d954ff7350 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -37,8 +37,6 @@ CSend::CSend(HWND /*Owner*/, MCONTACT hContact, bool bAsync, bool bSilent) : m_bSilent(bSilent), m_pszFile(nullptr), m_pszFileDesc(nullptr), - m_URL(nullptr), - m_URLthumb(nullptr), m_pszSendTyp(nullptr), m_pszProto(nullptr), // m_hContact(hContact), // initialized below @@ -46,7 +44,6 @@ CSend::CSend(HWND /*Owner*/, MCONTACT hContact, bool bAsync, bool bSilent) : m_ChatRoom(0), // m_PFflag(0), m_cbEventMsg(0), - m_szEventMsg(nullptr), m_hSend(nullptr), m_hOnSend(nullptr), m_ErrorMsg(nullptr), @@ -59,9 +56,6 @@ CSend::~CSend() { mir_free(m_pszFile); mir_free(m_pszFileDesc); - mir_free(m_URL); - mir_free(m_URLthumb); - mir_free(m_szEventMsg); mir_free(m_ErrorMsg); mir_free(m_ErrorTitle); if (m_hOnSend) UnhookEvent(m_hOnSend); @@ -75,10 +69,6 @@ void CSend::SetContact(MCONTACT hContact) if (hContact) { m_pszProto = GetContactProto(hContact); m_ChatRoom = db_get_b(hContact, m_pszProto, "ChatRoom", 0); - /* - m_PFflag = hasCap(PF1_URLSEND); - m_PFflag = hasCap(PF1_CHAT); - m_PFflag = hasCap(PF1_IMSEND);// */ } } @@ -236,17 +226,11 @@ void CSend::svcSendMsgExit(const char* szMessage) Exit(res); return; } else { - mir_freeAndNil(m_szEventMsg); - m_cbEventMsg = (DWORD)mir_strlen(szMessage) + 1; - m_szEventMsg = (char*)mir_realloc(m_szEventMsg, (sizeof(char) * m_cbEventMsg)); - memset(m_szEventMsg, 0, (sizeof(char) * m_cbEventMsg)); - mir_strcpy(m_szEventMsg, szMessage); + m_szEventMsg = szMessage; if (m_pszFileDesc && m_pszFileDesc[0] != NULL) { - char *temp = mir_u2a(m_pszFileDesc); - mir_stradd(m_szEventMsg, "\r\n"); - mir_stradd(m_szEventMsg, temp); - m_cbEventMsg = (DWORD)mir_strlen(m_szEventMsg) + 1; - mir_free(temp); + m_szEventMsg.Append("\r\n"); + m_szEventMsg.Append(_T2A(m_pszFileDesc)); + m_cbEventMsg = m_szEventMsg.GetLength() + 1; } //create a HookEventObj on ME_PROTO_ACK if (!m_hOnSend) { @@ -275,21 +259,15 @@ void CSend::svcSendFileExit() Error(LPGENW("%s requires a valid contact!"), m_pszSendTyp); Exit(ACKRESULT_FAILED); return; } - mir_freeAndNil(m_szEventMsg); - char* szFile = mir_u2a(m_pszFile); - m_cbEventMsg = (DWORD)mir_strlen(szFile) + 2; - m_szEventMsg = (char*)mir_realloc(m_szEventMsg, (sizeof(char) * m_cbEventMsg)); - memset(m_szEventMsg, 0, (sizeof(char) * m_cbEventMsg)); - mir_strcpy(m_szEventMsg, szFile); + + m_szEventMsg = _T2A(m_pszFile); + if (m_pszFileDesc && m_pszFileDesc[0] != NULL) { - char* temp = mir_u2a(m_pszFileDesc); - m_cbEventMsg += (DWORD)mir_strlen(temp); - m_szEventMsg = (char*)mir_realloc(m_szEventMsg, sizeof(char)*m_cbEventMsg); - mir_strcpy(m_szEventMsg + mir_strlen(szFile) + 1, temp); - m_szEventMsg[m_cbEventMsg - 1] = 0; - mir_free(temp); + m_szEventMsg.AppendChar(0); + m_szEventMsg.Append(_T2A(m_pszFileDesc)); } - mir_free(szFile); + + m_cbEventMsg = m_szEventMsg.GetLength() + 1; //create a HookEventObj on ME_PROTO_ACK if (!m_hOnSend) { @@ -319,12 +297,8 @@ int CSend::OnSend(void *obj, WPARAM, LPARAM lParam) { CSend* self = (CSend*)obj; ACKDATA *ack = (ACKDATA*)lParam; - if (ack->hProcess != self->m_hSend) return 0; - /* if(dat->waitingForAcceptance) { - SetTimer(hwndDlg,1,1000,NULL); - dat->waitingForAcceptance=0; - } - */ + if (ack->hProcess != self->m_hSend) + return 0; switch (ack->result) { case ACKRESULT_INITIALISING: //SetFtStatus(hwndDlg, LPGENW("Initialising..."), FTS_TEXT); break; @@ -360,8 +334,7 @@ int CSend::OnSend(void *obj, WPARAM, LPARAM lParam) self->DB_EventAdd((WORD)EVENTTYPE_URL); break; case ACKTYPE_FILE: - self->m_szEventMsg = (char*)mir_realloc(self->m_szEventMsg, sizeof(DWORD) + self->m_cbEventMsg); - memmove(self->m_szEventMsg + sizeof(DWORD), self->m_szEventMsg, self->m_cbEventMsg); + self->m_szEventMsg.Insert(0, "aaaa"); self->m_cbEventMsg += sizeof(DWORD); self->DB_EventAdd((WORD)EVENTTYPE_FILE); break; @@ -381,7 +354,7 @@ void CSend::DB_EventAdd(WORD EventType) dbei.timestamp = time(0); dbei.flags |= DBEF_UTF; dbei.cbBlob = m_cbEventMsg; - dbei.pBlob = (PBYTE)m_szEventMsg; + dbei.pBlob = (PBYTE)m_szEventMsg.GetString(); db_event_add(m_hContact, &dbei); } diff --git a/plugins/SendScreenshotPlus/src/CSend.h b/plugins/SendScreenshotPlus/src/CSend.h index 15d92a5572..5dcdb24224 100644 --- a/plugins/SendScreenshotPlus/src/CSend.h +++ b/plugins/SendScreenshotPlus/src/CSend.h @@ -50,87 +50,91 @@ const wchar_t SS_ERR_NORESPONSE[] =LPGENW("Got no response from %s (%i)"); ///////////////////////////////////////////////////////////////////////////////////////// -class CSend { - public: - CSend(HWND Owner, MCONTACT hContact, bool bAsync, bool bSilent=false); // oder (TfrmMain & Owner) - virtual ~CSend(); - - virtual int Send() = 0; // returns 1 if sent (you must delete class) and 0 when still sending (class deletes itself) - int SendSilent() {m_bAsync=m_bSilent=true; return Send();}; - - void SetFile(const wchar_t* file) { replaceStrW(m_pszFile, file); } - void SetFile(const char* file) { mir_free(m_pszFile), m_pszFile=mir_a2u(file); } - void SetDescription(const wchar_t* descr){ replaceStrW(m_pszFileDesc, descr); } - void SetContact(MCONTACT hContact); - char* GetURL(){return m_URL;}; - char* GetURLthumbnail(){return m_URLthumb;}; - BYTE GetEnableItem() {return m_EnableItem;}; - wchar_t* GetErrorMsg() {return m_ErrorMsg;}; - - bool m_bDeleteAfterSend; - protected: - bool m_bAsync; - bool m_bSilent; - wchar_t* m_pszFile; - wchar_t* m_pszFileDesc; - char* m_URL; - char* m_URLthumb; - static int OnSend(void *obj, WPARAM wParam, LPARAM lParam); - wchar_t* m_pszSendTyp; //hold string for error mess - char* m_pszProto; //Contact Proto Modul - MCONTACT m_hContact; //Contact handle - BYTE m_EnableItem; //hold flag for send type - BYTE m_ChatRoom; //is Contact chatroom - - bool hasCap(unsigned int Flag); -// unsigned int m_PFflag; - - void Error(LPCTSTR pszFormat, ...); - void svcSendFileExit(); - void svcSendMsgExit(const char* szMessage); - void Exit(unsigned int Result); - - DWORD m_cbEventMsg; //sizeof EventMsg(T) buffer - char* m_szEventMsg; //EventMsg char* - HANDLE m_hSend; //protocol send handle - HANDLE m_hOnSend; //HookEventObj on ME_PROTO_ACK - - MSGBOX m_box; - wchar_t* m_ErrorMsg; - wchar_t* m_ErrorTitle; - - void Unhook(){if(m_hOnSend) {UnhookEvent(m_hOnSend);m_hOnSend = nullptr;}} - void DB_EventAdd(WORD EventType); +class CSend +{ +public: + CSend(HWND Owner, MCONTACT hContact, bool bAsync, bool bSilent=false); // oder (TfrmMain & Owner) + virtual ~CSend(); + + virtual int Send() = 0; // returns 1 if sent (you must delete class) and 0 when still sending (class deletes itself) + int SendSilent() { m_bAsync = m_bSilent = true; return Send(); } - static INT_PTR CALLBACK ResultDialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam); - - /// HTTP upload helper stuff - enum HTTPFormFlags{ - HTTPFF_HEADER=0x80, - HTTPFF_TEXT =0x00, - HTTPFF_8BIT =0x01, - HTTPFF_FILE =0x02, - HTTPFF_INT =0x04, - }; - #define HTTPFORM_HEADER(str) str,HTTPFF_HEADER - #define HTTPFORM_TEXT(str) str,HTTPFF_TEXT - #define HTTPFORM_8BIT(str) str,HTTPFF_8BIT - #define HTTPFORM_FILE(str) str,HTTPFF_FILE - #define HTTPFORM_INT(int) (const char*)(int),HTTPFF_INT - struct HTTPFormData{ - const char* name; - union{ - const char* value_str; - intptr_t value_int; - }; - int flags; + void SetFile(const wchar_t* file) { replaceStrW(m_pszFile, file); } + void SetFile(const char* file) { mir_free(m_pszFile), m_pszFile=mir_a2u(file); } + void SetDescription(const wchar_t* descr){ replaceStrW(m_pszFileDesc, descr); } + void SetContact(MCONTACT hContact); + const char* GetURL() { return m_URL; } + const char* GetURLthumbnail() {return m_URLthumb; } + BYTE GetEnableItem() {return m_EnableItem;}; + wchar_t* GetErrorMsg() {return m_ErrorMsg;}; + + bool m_bDeleteAfterSend; + +protected: + bool m_bAsync; + bool m_bSilent; + wchar_t* m_pszFile; + wchar_t* m_pszFileDesc; + CMStringA m_URL; + CMStringA m_URLthumb; + static int OnSend(void *obj, WPARAM wParam, LPARAM lParam); + wchar_t* m_pszSendTyp; //hold string for error mess + char* m_pszProto; //Contact Proto Modul + MCONTACT m_hContact; //Contact handle + BYTE m_EnableItem; //hold flag for send type + BYTE m_ChatRoom; //is Contact chatroom + + void Error(LPCTSTR pszFormat, ...); + void svcSendFileExit(); + void svcSendMsgExit(const char* szMessage); + void Exit(unsigned int Result); + + DWORD m_cbEventMsg; //sizeof EventMsg(T) buffer + CMStringA m_szEventMsg; //EventMsg char* + HANDLE m_hSend; //protocol send handle + HANDLE m_hOnSend; //HookEventObj on ME_PROTO_ACK + + MSGBOX m_box; + wchar_t* m_ErrorMsg; + wchar_t* m_ErrorTitle; + + void Unhook(){if(m_hOnSend) {UnhookEvent(m_hOnSend);m_hOnSend = nullptr;}} + void DB_EventAdd(WORD EventType); + + static INT_PTR CALLBACK ResultDialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam); + + /// HTTP upload helper stuff + enum HTTPFormFlags + { + HTTPFF_HEADER = 0x80, + HTTPFF_TEXT = 0x00, + HTTPFF_8BIT = 0x01, + HTTPFF_FILE = 0x02, + HTTPFF_INT = 0x04, + }; + + #define HTTPFORM_HEADER(str) str,HTTPFF_HEADER + #define HTTPFORM_TEXT(str) str,HTTPFF_TEXT + #define HTTPFORM_8BIT(str) str,HTTPFF_8BIT + #define HTTPFORM_FILE(str) str,HTTPFF_FILE + #define HTTPFORM_INT(int) (const char*)(int),HTTPFF_INT + + struct HTTPFormData + { + const char *name; + union{ + const char* value_str; + intptr_t value_int; }; - static const char* GetHTMLContent(char* str, const char* startTag, const char* endTag); /// changes "str", can be successfully used only once - static int GetJSONString(const char* json, size_t jsonlen, const char* variable, char* value, size_t valuesize); - static int GetJSONInteger(const char* json, size_t jsonlen, const char* variable,int defvalue); - static bool GetJSONBool(const char* json, size_t jsonlen, const char* variable); - void HTTPFormDestroy(NETLIBHTTPREQUEST* nlhr); /// use to free data inside "nlhr" created by HTTPFormCreate - int HTTPFormCreate(NETLIBHTTPREQUEST* nlhr, int requestType, const char* url, HTTPFormData* frm, size_t frmNum); /// returns "0" on success, Exit() will be called on failure (stop processing) + int flags; + }; + + static const char* GetHTMLContent(char* str, const char* startTag, const char* endTag); /// changes "str", can be successfully used only once + static int GetJSONString(const char* json, size_t jsonlen, const char* variable, char* value, size_t valuesize); + static int GetJSONInteger(const char* json, size_t jsonlen, const char* variable,int defvalue); + static bool GetJSONBool(const char* json, size_t jsonlen, const char* variable); + void HTTPFormDestroy(NETLIBHTTPREQUEST* nlhr); /// use to free data inside "nlhr" created by HTTPFormCreate + int HTTPFormCreate(NETLIBHTTPREQUEST* nlhr, int requestType, const char* url, HTTPFormData* frm, size_t frmNum); /// returns "0" on success, Exit() will be called on failure (stop processing) }; #endif 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 { diff --git a/plugins/SendScreenshotPlus/src/CSendHTTPServer.h b/plugins/SendScreenshotPlus/src/CSendHTTPServer.h index 7bb88ff279..5abde15394 100644 --- a/plugins/SendScreenshotPlus/src/CSendHTTPServer.h +++ b/plugins/SendScreenshotPlus/src/CSendHTTPServer.h @@ -39,8 +39,8 @@ public: int Send() override; protected: - char* m_pszFileName; - char* m_fsi_pszSrvPath; + char* m_pszFileName; + CMStringA m_fsi_pszSrvPath; char* m_fsi_pszRealPath; STFileShareInfo m_fsi; diff --git a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp index d239bae6f4..4c6e6acdea 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp @@ -83,18 +83,13 @@ void CSendHost_ImageShack::SendThread() const char* url = nullptr; url = GetHTMLContent(reply->pData, "<image_link>", "</image_link>"); if (url && *url) { - mir_free(m_URL), m_URL = mir_strdup(url); - mir_free(m_URLthumb), m_URLthumb = mir_strdup(m_URL); - size_t extlen; - char* pos = strrchr(m_URLthumb, '.'); - if (pos && (extlen = mir_strlen(pos))>2) { - char* tmp = mir_strdup(pos); - memcpy(pos, ".th", 3); - memcpy(pos + 3, tmp, extlen - 3); - mir_stradd(m_URLthumb, tmp + extlen - 3); - mir_free(tmp); - } - else mir_freeAndNil(m_URLthumb); + m_URLthumb = m_URL = url; + + int idx = m_URLthumb.ReverseFind('.'); + if (idx != -1 && m_URLthumb.GetLength() - idx > 2) + m_URLthumb.Insert(idx + 1, "th"); + else + m_URLthumb.Empty(); Netlib_FreeHttpRequest(reply); svcSendMsgExit(url); return; diff --git a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp index f9c1bdd40c..6c6dabb716 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp @@ -70,15 +70,11 @@ void CSendHost_Imgur::SendThread(void* obj) if (GetJSONBool(reply->pData, reply->dataLength, "success")) { GetJSONString(reply->pData, reply->dataLength, "data[link]", buf, sizeof(buf)); - mir_free(self->m_URL), self->m_URL = mir_strdup(buf); - char* ext = strrchr(self->m_URL, '.'); - if (ext) { - size_t thumblen = mir_strlen(self->m_URL) + 2; - mir_free(self->m_URLthumb), self->m_URLthumb = (char*)mir_alloc(thumblen); - thumblen = ext - self->m_URL; - memcpy(self->m_URLthumb, self->m_URL, thumblen); - self->m_URLthumb[thumblen] = 'm'; // 320x320, see http://api.imgur.com/models/image - mir_strcpy(self->m_URLthumb + thumblen + 1, self->m_URL + thumblen); + self->m_URL = buf; + int idx = self->m_URL.ReverseFind('.'); + if (idx != -1) { + self->m_URLthumb = self->m_URL; + self->m_URLthumb.Insert(idx, 'm'); } Netlib_FreeHttpRequest(reply); self->svcSendMsgExit(self->m_URL); return; diff --git a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp index 66fd652fbf..d18d1a3e03 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp @@ -89,7 +89,7 @@ void CSendHost_UploadPie::SendThread(void* obj) } while (url); if (url) { - mir_free(self->m_URL), self->m_URL = mir_strdup(url); + self->m_URL = url; Netlib_FreeHttpRequest(reply); self->svcSendMsgExit(url); return; } diff --git a/plugins/SendScreenshotPlus/src/mir_string.cpp b/plugins/SendScreenshotPlus/src/mir_string.cpp deleted file mode 100644 index a730f1babf..0000000000 --- a/plugins/SendScreenshotPlus/src/mir_string.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/*
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (c) 2012-18 Miranda NG team (https://miranda-ng.org),
-Copyright (c) 2000-09 Miranda ICQ/IM project,
-
-This file is part of Send Screenshot Plus, a Miranda IM plugin.
-Copyright (c) 2010 Ing.U.Horn
-
-Parts of this file based on original sorce code
-from UserInfoEx Plugin
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-void mir_stradd(char* &pszDest, const char* pszSrc)
-{
- if (!pszSrc)
- return;
-
- if (!pszDest)
- pszDest = mir_strdup(pszSrc);
- else {
- size_t lenDest = mir_strlen(pszDest);
- size_t lenSrc = mir_strlen(pszSrc);
- size_t lenNew = lenDest + lenSrc + 1;
- pszDest = (char *)mir_realloc(pszDest, sizeof(char)* lenNew);
-
- mir_strcpy(pszDest + lenDest, pszSrc);
- pszDest[lenNew - 1] = 0;
- }
-}
-
-void mir_wstradd(wchar_t* &pszDest, const wchar_t* pszSrc)
-{
- if (!pszSrc)
- return;
-
- if (!pszDest)
- pszDest = mir_wstrdup(pszSrc);
- else {
- size_t lenDest = mir_wstrlen(pszDest);
- size_t lenSrc = mir_wstrlen(pszSrc);
- size_t lenNew = lenDest + lenSrc + 1;
- pszDest = (wchar_t *)mir_realloc(pszDest, sizeof(wchar_t)*lenNew);
-
- mir_wstrcpy(pszDest + lenDest, pszSrc);
- pszDest[lenNew - 1] = 0;
- }
-}
diff --git a/plugins/SendScreenshotPlus/src/mir_string.h b/plugins/SendScreenshotPlus/src/mir_string.h deleted file mode 100644 index 8393aadb07..0000000000 --- a/plugins/SendScreenshotPlus/src/mir_string.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -Miranda NG: the free IM client for Microsoft* Windows* - -Copyright (c) 2012-18 Miranda NG team (https://miranda-ng.org), -Copyright (c) 2000-09 Miranda ICQ/IM project, - -This file is part of Send Screenshot Plus, a Miranda IM plugin. -Copyright (c) 2010 Ing.U.Horn - -Parts of this file based on original sorce code -from UserInfoEx Plugin - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef _MIR_STRING_H_INCLUDED_ -#define _MIR_STRING_H_INCLUDED_ - -#define mir_freeAndNil(ptr) mir_free(ptr),ptr=NULL -void mir_stradd(char* &pszDest, const char* pszSrc); -void mir_wstradd(wchar_t* &pszDest, const wchar_t* pszSrc); - -#endif /* _MIR_STRING_H_INCLUDED_ */ diff --git a/plugins/SendScreenshotPlus/src/stdafx.h b/plugins/SendScreenshotPlus/src/stdafx.h index f9627ae6ce..3ace09ca3e 100644 --- a/plugins/SendScreenshotPlus/src/stdafx.h +++ b/plugins/SendScreenshotPlus/src/stdafx.h @@ -75,7 +75,6 @@ using namespace std; #include <m_userinfoex.h> #include <m_cloudfile.h> -#include "mir_string.h" #include "ctrl_button.h" #include "dlg_msgbox.h" #include "resource.h" diff --git a/plugins/SendScreenshotPlus/src/version.h b/plugins/SendScreenshotPlus/src/version.h index 85869bc7e5..cbcdd47655 100644 --- a/plugins/SendScreenshotPlus/src/version.h +++ b/plugins/SendScreenshotPlus/src/version.h @@ -1,6 +1,6 @@ #define __MAJOR_VERSION 0 -#define __MINOR_VERSION 8 -#define __RELEASE_NUM 10 +#define __MINOR_VERSION 9 +#define __RELEASE_NUM 0 #define __BUILD_NUM 1 #include <stdver.h> |