diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 00:07:01 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 00:07:01 +0000 |
commit | b2fad485cd5b41744ef0cc4a02722c021afd926c (patch) | |
tree | aa19403cd699066600e8306be8ad33e4a17fba6f /protocols/IcqOscarJ/src/i18n.cpp | |
parent | fc62f1f1e1f8af40a1f7efe0ba3afc358fb66ef3 (diff) |
ZeroMemory -> memset, few bugs fised
git-svn-id: http://svn.miranda-ng.org/main/trunk@11184 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src/i18n.cpp')
-rw-r--r-- | protocols/IcqOscarJ/src/i18n.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/IcqOscarJ/src/i18n.cpp b/protocols/IcqOscarJ/src/i18n.cpp index 5f2c1f4f2a..5b7ab1d2a2 100644 --- a/protocols/IcqOscarJ/src/i18n.cpp +++ b/protocols/IcqOscarJ/src/i18n.cpp @@ -273,7 +273,7 @@ int __stdcall utf8_encode(const char *from, char **to) }
WCHAR *unicode = (WCHAR*)_alloca((wchars + 1) * sizeof(WCHAR));
- ZeroMemory(unicode, (wchars + 1) * sizeof(WCHAR));
+ memset(unicode, 0, ((wchars + 1) * sizeof(WCHAR)));
int err = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, from, (int)mir_strlen(from), unicode, wchars);
if (err != wchars) {
@@ -308,7 +308,7 @@ char* __stdcall ansi_to_utf8_codepage(const char *ansi, WORD wCp) {
size_t wchars = mir_strlen(ansi);
WCHAR *unicode = (WCHAR*)_alloca((wchars + 1) * sizeof(WCHAR));
- ZeroMemory(unicode, (wchars + 1) * sizeof(WCHAR));
+ memset(unicode, 0, ((wchars + 1) * sizeof(WCHAR)));
MultiByteToWideChar(wCp, MB_PRECOMPOSED, ansi, (int)wchars, unicode, (int)wchars);
@@ -331,7 +331,7 @@ int __stdcall utf8_decode_codepage(const char *from, char **to, WORD wCp) if (bHasCP_UTF8) {
size_t inlen = mir_strlen(from) + 1;
WCHAR *wszTemp = (WCHAR *)_alloca(inlen * sizeof(WCHAR));
- ZeroMemory(wszTemp, inlen * sizeof(WCHAR));
+ memset(wszTemp, 0, (inlen * sizeof(WCHAR)));
// Convert the UTF-8 string to UCS
if (MultiByteToWideChar(CP_UTF8, 0, from, -1, wszTemp, (int)inlen)) {
@@ -402,13 +402,13 @@ int __stdcall utf8_decode_static(const char *from, char *to, size_t to_size) return 0;
// Clear target
- ZeroMemory(to, to_size);
+ memset(to, 0, to_size);
// Use the native conversion routines when available
if (bHasCP_UTF8) {
size_t inlen = mir_strlen(from) + 1;
WCHAR *wszTemp = (WCHAR*)_alloca(inlen * sizeof(WCHAR));
- ZeroMemory(wszTemp, inlen * sizeof(WCHAR));
+ memset(wszTemp, 0, (inlen * sizeof(WCHAR)));
// Convert the UTF-8 string to UCS
if (MultiByteToWideChar(CP_UTF8, 0, from, -1, wszTemp, (int)inlen)) {
@@ -460,7 +460,7 @@ WCHAR* __stdcall ansi_to_unicode(const char *ansi) char* __stdcall unicode_to_ansi_static(const WCHAR *unicode, char *ansi, size_t ansi_size)
{
- ZeroMemory(ansi, ansi_size);
+ memset(ansi, 0, ansi_size);
if (WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, unicode, (int)mir_wstrlen(unicode), ansi, (int)ansi_size, NULL, NULL) > 1)
return ansi;
|