summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-01 00:07:01 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-01 00:07:01 +0000
commitb2fad485cd5b41744ef0cc4a02722c021afd926c (patch)
treeaa19403cd699066600e8306be8ad33e4a17fba6f /protocols/IcqOscarJ
parentfc62f1f1e1f8af40a1f7efe0ba3afc358fb66ef3 (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')
-rw-r--r--protocols/IcqOscarJ/src/chan_04close.cpp2
-rw-r--r--protocols/IcqOscarJ/src/i18n.cpp12
-rw-r--r--protocols/IcqOscarJ/src/icq_filetransfer.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp6
-rw-r--r--protocols/IcqOscarJ/src/icq_server.cpp2
-rw-r--r--protocols/IcqOscarJ/src/oscar_filetransfer.cpp2
-rw-r--r--protocols/IcqOscarJ/src/utilities.cpp2
7 files changed, 14 insertions, 14 deletions
diff --git a/protocols/IcqOscarJ/src/chan_04close.cpp b/protocols/IcqOscarJ/src/chan_04close.cpp
index 12eef821ba..3c774e5ce0 100644
--- a/protocols/IcqOscarJ/src/chan_04close.cpp
+++ b/protocols/IcqOscarJ/src/chan_04close.cpp
@@ -189,7 +189,7 @@ void CIcqProto::handleSignonError(WORD wError)
case 0x06: // Internal Client error (bad input to authorizer)
case 0x07: // Invalid account
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
- ZeroMemory(m_szPassword, sizeof(m_szPassword));
+ memset(m_szPassword, 0, sizeof(m_szPassword));
icq_LogFatalParam(LPGEN("Connection failed.\nYour ICQ number or password was rejected (%d)."), wError);
break;
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;
diff --git a/protocols/IcqOscarJ/src/icq_filetransfer.cpp b/protocols/IcqOscarJ/src/icq_filetransfer.cpp
index 32df7bae33..6afa3fef6f 100644
--- a/protocols/IcqOscarJ/src/icq_filetransfer.cpp
+++ b/protocols/IcqOscarJ/src/icq_filetransfer.cpp
@@ -27,7 +27,7 @@
static void file_buildProtoFileTransferStatus(filetransfer* ft, PROTOFILETRANSFERSTATUS* pfts)
{
- ZeroMemory(pfts, sizeof(PROTOFILETRANSFERSTATUS));
+ memset(pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts->cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts->hContact = ft->hContact;
pfts->flags = PFTS_UTF | (ft->sending ? PFTS_SENDING : PFTS_RECEIVING); /* Standard FT is Ansi only */
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index 2e4f3045de..158f76ffc6 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -93,7 +93,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) :
HookProtoEvent(ME_CLIST_GROUPCHANGE, &CIcqProto::ServListCListGroupChange);
// Initialize status message struct
- ZeroMemory(&m_modeMsgs, sizeof(icq_mode_messages));
+ memset(&m_modeMsgs, 0, sizeof(icq_mode_messages));
m_modeMsgsMutex = new icq_critical_section();
connectionHandleMutex = new icq_critical_section();
localSeqMutex = new icq_critical_section();
@@ -1023,7 +1023,7 @@ int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int flags, int nContacts,
// This is kinda messy, but there is no simple way to do it. First
// we need to calculate the length of the packet.
contacts = (struct icq_contactsend_s*)_alloca(sizeof(struct icq_contactsend_s)*nContacts);
- ZeroMemory(contacts, sizeof(struct icq_contactsend_s)*nContacts);
+ memset(contacts, 0, (sizeof(struct icq_contactsend_s) * nContacts));
size_t nDataLen = 0, nNamesLen = 0;
for (i = 0; i < nContacts; i++) {
@@ -1138,7 +1138,7 @@ int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int flags, int nContacts,
// This is kinda messy, but there is no simple way to do it. First
// we need to calculate the length of the packet.
contacts = (struct icq_contactsend_s*)_alloca(sizeof(struct icq_contactsend_s)*nContacts);
- ZeroMemory(contacts, sizeof(struct icq_contactsend_s)*nContacts);
+ memset(contacts, 0, (sizeof(struct icq_contactsend_s) * nContacts));
{
size_t nBodyLength = 0;
for (i = 0; i < nContacts; i++) {
diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp
index 94356f5602..5ea930f0b7 100644
--- a/protocols/IcqOscarJ/src/icq_server.cpp
+++ b/protocols/IcqOscarJ/src/icq_server.cpp
@@ -110,7 +110,7 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam)
while (serverThreadHandle) {
if (info.bReinitRecver) { // we reconnected, reinit struct
info.bReinitRecver = false;
- ZeroMemory(&packetRecv, sizeof(packetRecv));
+ memset(&packetRecv, 0, sizeof(packetRecv));
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = 1000;
}
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
index c656024087..ade1819f0b 100644
--- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
+++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
@@ -1031,7 +1031,7 @@ void CIcqProto::oftFileResume(oscar_filetransfer *ft, int action, const TCHAR *s
static void oft_buildProtoFileTransferStatus(oscar_filetransfer* ft, PROTOFILETRANSFERSTATUS* pfts)
{
- ZeroMemory(pfts, sizeof(PROTOFILETRANSFERSTATUS));
+ memset(pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts->cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts->hContact = ft->hContact;
pfts->flags = PFTS_UTF + ((ft->flags & OFTF_SENDING) ? PFTS_SENDING : PFTS_RECEIVING);
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp
index 32e8baa7c8..b452758539 100644
--- a/protocols/IcqOscarJ/src/utilities.cpp
+++ b/protocols/IcqOscarJ/src/utilities.cpp
@@ -1397,7 +1397,7 @@ void* __fastcall SAFE_MALLOC(size_t size)
if (size) {
p = malloc(size);
if (p)
- ZeroMemory(p, size);
+ memset(p, 0, size);
}
return p;
}