diff options
-rw-r--r-- | protocols/IcqOscarJ/src/icq_proto.cpp | 10 | ||||
-rw-r--r-- | protocols/Yahoo/src/libyahoo2/crypt.cpp | 9 |
2 files changed, 7 insertions, 12 deletions
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 0227dd5ed1..7860b1190c 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -1163,7 +1163,7 @@ int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONT char *pBody, *pBuffer = pBody = (char *)SAFE_MALLOC(nBodyLength);
null_strcpy(pBuffer, szCount, nBodyLength - 1);
pBuffer += mir_strlen(pBuffer);
- *pBuffer++ = char(0xFE);
+ *pBuffer++ = -2;
for (i = 0; i < nContacts; i++) {
if (contacts[i].uin) {
_itoa(contacts[i].uin, szContactUin, 10);
@@ -1172,10 +1172,10 @@ int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONT else
strcpy(pBuffer, contacts[i].uid);
pBuffer += mir_strlen(pBuffer);
- *pBuffer++ = char(0xFE);
+ *pBuffer++ = -2;
strcpy(pBuffer, contacts[i].szNick);
pBuffer += mir_strlen(pBuffer);
- *pBuffer++ = char(0xFE);
+ *pBuffer++ = -2;
}
for (i = 0; i < nContacts; i++) { // release memory
@@ -1188,10 +1188,8 @@ int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONT if (m_bDCMsgEnabled && IsDirectConnectionOpen(hContact, DIRECTCONN_STANDARD, 0)) {
int iRes = icq_SendDirectMessage(hContact, pBody, nBodyLength, pCookieData, NULL);
-
if (iRes) {
SAFE_FREE((void**)&pBody);
-
return iRes; // we succeded, return
}
}
@@ -1500,7 +1498,7 @@ int __cdecl CIcqProto::SendUrl(MCONTACT hContact, int, const char* url) size_t nBodyLen = nUrlLen + nDescLen + 2;
char *szBody = (char *)_alloca(nBodyLen);
strcpy(szBody, szDesc);
- szBody[nDescLen] = char(0xFE); // Separator
+ szBody[nDescLen] = -2; // Separator
strcpy(szBody + nDescLen + 1, url);
if (m_bDCMsgEnabled && IsDirectConnectionOpen(hContact, DIRECTCONN_STANDARD, 0)) {
diff --git a/protocols/Yahoo/src/libyahoo2/crypt.cpp b/protocols/Yahoo/src/libyahoo2/crypt.cpp index b54456fd85..29f22e96f9 100644 --- a/protocols/Yahoo/src/libyahoo2/crypt.cpp +++ b/protocols/Yahoo/src/libyahoo2/crypt.cpp @@ -47,14 +47,11 @@ static const char b64t[65] = char *yahoo_crypt(char *key, char *salt)
{
char *buffer = NULL;
- int buflen = 0;
- int needed = 3 + strlen (salt) + 1 + 26 + 1;
+ size_t buflen = 0, needed = 3 + strlen (salt) + 1 + 26 + 1;
BYTE alt_result[16];
mir_md5_state_t ctx;
mir_md5_state_t alt_ctx;
- int salt_len;
- int key_len;
int cnt;
char *cp;
@@ -70,8 +67,8 @@ char *yahoo_crypt(char *key, char *salt) /* Skip salt prefix. */
salt += sizeof (md5_salt_prefix) - 1;
- salt_len = (int)MIN (strcspn (salt, "$"), 8);
- key_len = (int)strlen (key);
+ int salt_len = (int)MIN(strcspn(salt, "$"), 8);
+ int key_len = (int)strlen(key);
/* Prepare for the real work. */
mir_md5_init(&ctx);
|