diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-12-20 19:10:47 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-12-20 19:10:47 +0000 |
commit | 58e5ea7bf98f8468f869522c89ffe961112bd98d (patch) | |
tree | 69cd89a853c4f315247e5724c6005a3d9e5d1e4e /protocols/FacebookRM/src/messages.cpp | |
parent | 9f98d623506e7b7a86561152807526aeb2bb5be3 (diff) |
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
Diffstat (limited to 'protocols/FacebookRM/src/messages.cpp')
-rw-r--r-- | protocols/FacebookRM/src/messages.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
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_; } |