From 688f55ba998c19304a29727c910504903f4cc49a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 30 Nov 2014 18:51:36 +0000 Subject: lstr* replacements git-svn-id: http://svn.miranda-ng.org/main/trunk@11176 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/IcqOscarJ/src/icq_filerequests.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'protocols/IcqOscarJ/src/icq_filerequests.cpp') diff --git a/protocols/IcqOscarJ/src/icq_filerequests.cpp b/protocols/IcqOscarJ/src/icq_filerequests.cpp index e66aedc990..b357356640 100644 --- a/protocols/IcqOscarJ/src/icq_filerequests.cpp +++ b/protocols/IcqOscarJ/src/icq_filerequests.cpp @@ -80,12 +80,10 @@ void CIcqProto::handleFileAck(PBYTE buf, size_t wLen, DWORD dwUin, DWORD dwCooki unpackString(&buf, pszFileName, wFilenameLength); pszFileName[wFilenameLength] = '\0'; } - wLen = wLen - 2 - wFilenameLength; + wLen -= wFilenameLength+2; - if (wLen >= 4) { // Total filesize + if (wLen >= 4) unpackLEDWord(&buf, &dwFileSize); - wLen -= 4; - } else dwFileSize = 0; @@ -111,7 +109,7 @@ filetransfer* CIcqProto::CreateFileTransfer(MCONTACT hContact, DWORD dwUin, int // pszDescription points to a string with the reason // buf points to the first data after the string -void CIcqProto::handleFileRequest(PBYTE buf, size_t wLen, DWORD dwUin, DWORD dwCookie, DWORD dwID1, DWORD dwID2, char* pszDescription, int nVersion, BOOL bDC) +void CIcqProto::handleFileRequest(PBYTE buf, size_t cbLen, DWORD dwUin, DWORD dwCookie, DWORD dwID1, DWORD dwID2, char* pszDescription, int nVersion, BOOL bDC) { BOOL bEmptyDesc = FALSE; if (mir_strlen(pszDescription) == 0) { @@ -121,7 +119,6 @@ void CIcqProto::handleFileRequest(PBYTE buf, size_t wLen, DWORD dwUin, DWORD dwC // Empty port+pad buf += 4; - wLen -= 4; // Filename size_t wFilenameLength; @@ -135,12 +132,9 @@ void CIcqProto::handleFileRequest(PBYTE buf, size_t wLen, DWORD dwUin, DWORD dwC unpackString(&buf, pszFileName, wFilenameLength); pszFileName[wFilenameLength] = '\0'; - wLen = wLen - 2 - wFilenameLength; - // Total filesize DWORD dwFileSize; unpackLEDWord(&buf, &dwFileSize); - wLen -= 4; int bAdded; MCONTACT hContact = HContactFromUIN(dwUin, &bAdded); @@ -183,7 +177,6 @@ void CIcqProto::handleDirectCancel(directconnect *dc, PBYTE buf, size_t wLen, WO void CIcqProto::icq_CancelFileTransfer(MCONTACT hContact, filetransfer* ft) { DWORD dwCookie; - if (FindCookieByData(ft, &dwCookie, NULL)) FreeCookie(dwCookie); /* this bit stops a send that's waiting for acceptance */ -- cgit v1.2.3