summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src/customsmiley.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SmileyAdd/src/customsmiley.cpp')
-rw-r--r--plugins/SmileyAdd/src/customsmiley.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/SmileyAdd/src/customsmiley.cpp b/plugins/SmileyAdd/src/customsmiley.cpp
index 4c0a75a11a..a41920d140 100644
--- a/plugins/SmileyAdd/src/customsmiley.cpp
+++ b/plugins/SmileyAdd/src/customsmiley.cpp
@@ -77,14 +77,14 @@ bool SmileyCType::CreateTriggerText(char* text)
int len = (int)strlen(text);
if (len == 0) return false;
- int reslen = Netlib_GetBase64DecodedBufferSize(len)+1;
- char* res = (char*)alloca(reslen);
-
- NETLIBBASE64 nlb = { text, len, ( PBYTE )res, reslen };
- if (!CallService(MS_NETLIB_BASE64DECODE, 0, LPARAM( &nlb ))) return false;
- res[nlb.cbDecoded] = 0;
+ unsigned reslen;
+ char* res = (char*)mir_base64_decode(text, &reslen);
+ if (res == NULL)
+ return false;
+ char save = res[reslen]; res[reslen] = 0; // safe because of mir_alloc
TCHAR *txt = mir_utf8decodeT(res);
+ res[reslen] = save;
if (txt == NULL) return false;