From e2c2a1f5a84c6c9b705dc85c6a2dd1f97edd57e4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 22 May 2015 16:04:17 +0000 Subject: T2Utf - handy replacement for ptrA git-svn-id: http://svn.miranda-ng.org/main/trunk@13758 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SimpleAR/src/Main.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'plugins/SimpleAR') diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 5b468ea34b..904cf42461 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -220,17 +220,16 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) mir_sntprintf(ptszTemp2, msgLen+5, _T("%s\r\n\r\n%s"), ptszTemp.c_str(), dbv.ptszVal); if (ServiceExists(MS_VARS_FORMATSTRING)) { - FORMATINFO fi; - - memset(&fi, 0, sizeof(fi)); + FORMATINFO fi = { 0 }; fi.cbSize = sizeof(fi); fi.flags = FIF_TCHAR; fi.tszFormat = ptszTemp2; ptszTemp = (TCHAR*)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0); - }else - ptszTemp = Utils_ReplaceVarsT(ptszTemp2); - char* pszUtf = mir_utf8encodeT(ptszTemp); - CallContactService(hContact, PSS_MESSAGE, 0, (LPARAM)pszUtf); + } + else ptszTemp = Utils_ReplaceVarsT(ptszTemp2); + + T2Utf pszUtf(ptszTemp); + CallContactService(hContact, PSS_MESSAGE, 0, pszUtf); dbei.cbSize = sizeof(dbei); dbei.eventType = EVENTTYPE_MESSAGE; @@ -242,7 +241,6 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) db_event_add(hContact, &dbei); mir_free(ptszTemp2); - mir_free(pszUtf); if (dbvNick.ptszVal) db_free(&dbvNick); if (dbvHead.ptszVal) -- cgit v1.2.3