From 535b7c921c5fc4d3f6cc6bff4ad321805e0ab070 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 11 Aug 2015 09:33:30 +0000 Subject: code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@14904 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MSN/src/msn_mime.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'protocols/MSN/src/msn_mime.cpp') diff --git a/protocols/MSN/src/msn_mime.cpp b/protocols/MSN/src/msn_mime.cpp index 7be06009a9..32428ca53b 100644 --- a/protocols/MSN/src/msn_mime.cpp +++ b/protocols/MSN/src/msn_mime.cpp @@ -432,12 +432,8 @@ wchar_t* MimeHeaders::decode(const char* val) switch (*enc) { case 'b': case 'B': - { - char* dec = (char*)mir_base64_decode(fld, 0); - mir_strcpy(fld, dec); - mir_free(dec); + mir_strcpy(fld, ptrA((char*)mir_base64_decode(fld, 0))); break; - } case 'q': case 'Q': @@ -445,21 +441,19 @@ wchar_t* MimeHeaders::decode(const char* val) break; } - if (_stricmp(cp, "UTF-8") == 0) { + if (_stricmp(cp, "UTF-8") == 0) sz = utf8toutf16(fld, resp); - ssz -= sz; resp += sz; - } else { - int sz = MultiByteToWideChar(FindCP(cp), 0, fld, -1, resp, (int)ssz); + sz = MultiByteToWideChar(FindCP(cp), 0, fld, -1, resp, (int)ssz); if (sz == 0) sz = MultiByteToWideChar(CP_ACP, 0, fld, -1, resp, (int)ssz); - ssz -= --sz; resp += sz; + sz--; } + ssz -= sz; resp += sz; p = pe + 2; } utf8toutf16(p, resp); - return res; } -- cgit v1.2.3