From 58e5ea7bf98f8468f869522c89ffe961112bd98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 20 Dec 2014 19:10:47 +0000 Subject: Facebook: Various code improvements (as reported by Coverity analyser); version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@11546 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/messages.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'protocols/FacebookRM/src/messages.cpp') diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp index de6811cf2c..192ef1fb8c 100644 --- a/protocols/FacebookRM/src/messages.cpp +++ b/protocols/FacebookRM/src/messages.cpp @@ -114,11 +114,10 @@ void FacebookProto::SendChatMsgWorker(void *p) int FacebookProto::SendMsg(MCONTACT hContact, int flags, const char *msg) { // TODO: msg comes as Unicode (retyped wchar_t*), why should we convert it as ANSI to UTF-8? o_O - if (flags & PREF_UNICODE) - msg = mir_utf8encode(msg); + std::string message = (flags & PREF_UNICODE) ? ptrA(mir_utf8encode(msg)) : msg; facy.msgid_ = (facy.msgid_ % 1024) + 1; - ForkThread(&FacebookProto::SendMsgWorker, new send_direct(hContact, msg, (HANDLE)facy.msgid_)); + ForkThread(&FacebookProto::SendMsgWorker, new send_direct(hContact, message, (HANDLE)facy.msgid_)); return facy.msgid_; } -- cgit v1.2.3