diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-22 16:04:17 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-22 16:04:17 +0000 |
commit | e2c2a1f5a84c6c9b705dc85c6a2dd1f97edd57e4 (patch) | |
tree | ba79bdcede96f80039f8b88d2791f198b9ec2981 /plugins/SimpleAR/src | |
parent | f8e34b5f83f3ce5f39d541e9068b6b8cb6d92acd (diff) |
T2Utf - handy replacement for ptrA<mir_utf8decodeT()>
git-svn-id: http://svn.miranda-ng.org/main/trunk@13758 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SimpleAR/src')
-rw-r--r-- | plugins/SimpleAR/src/Main.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
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)
|