summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn_mime.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-08-11 09:33:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-08-11 09:33:30 +0000
commit535b7c921c5fc4d3f6cc6bff4ad321805e0ab070 (patch)
tree564e311ca0d6b04755cb72c7b82ef42647529431 /protocols/MSN/src/msn_mime.cpp
parent7196463c057555a935707304b48e0a2ab2ea3443 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@14904 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_mime.cpp')
-rw-r--r--protocols/MSN/src/msn_mime.cpp16
1 files changed, 5 insertions, 11 deletions
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;
}