summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/tlv.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-11-30 16:19:57 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-11-30 16:19:57 +0000
commitf485b5e4b683cc31168d440dc89574913e814852 (patch)
tree1d5e234805492a7e534d2edaddb2d4f3c75bdd77 /protocols/IcqOscarJ/src/tlv.cpp
parenta30574fe4abb9065a8a67a6ce992ce11deef2564 (diff)
all buffer lengths are of size_t now
git-svn-id: http://svn.miranda-ng.org/main/trunk@11173 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src/tlv.cpp')
-rw-r--r--protocols/IcqOscarJ/src/tlv.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/IcqOscarJ/src/tlv.cpp b/protocols/IcqOscarJ/src/tlv.cpp
index ad1846e167..33fe38f7cd 100644
--- a/protocols/IcqOscarJ/src/tlv.cpp
+++ b/protocols/IcqOscarJ/src/tlv.cpp
@@ -30,15 +30,15 @@
#include "icqoscar.h"
/* set maxTlvs<=0 to get all TLVs in length, or a positive integer to get at most the first n */
-oscar_tlv_chain* readIntoTLVChain(BYTE **buf, WORD wLen, int maxTlvs)
+oscar_tlv_chain* readIntoTLVChain(BYTE **buf, size_t wLen, int maxTlvs)
{
oscar_tlv_chain *now, *last, *chain = NULL;
WORD now_tlv_len;
- int len = wLen;
if (!buf || !wLen)
return NULL;
+ intptr_t len = wLen;
while (len > 0) { /* don't use unsigned variable for this check */
now = (oscar_tlv_chain *)SAFE_MALLOC(sizeof(oscar_tlv_chain));
@@ -113,7 +113,7 @@ WORD oscar_tlv_chain::getChainLength()
return len;
}
-oscar_tlv* oscar_tlv_chain::putTLV(WORD wType, WORD wLen, BYTE *pData, BOOL bReplace)
+oscar_tlv* oscar_tlv_chain::putTLV(WORD wType, size_t wLen, BYTE *pData, BOOL bReplace)
{
oscar_tlv *tlv = getTLV(wType, 1);
@@ -132,7 +132,7 @@ oscar_tlv* oscar_tlv_chain::putTLV(WORD wType, WORD wLen, BYTE *pData, BOOL bRep
}
}
if (tlv) {
- tlv->wLen = wLen;
+ tlv->wLen = WORD(wLen);
tlv->pData = (PBYTE)SAFE_MALLOC(wLen);
memcpy(tlv->pData, pData, wLen);
}
@@ -278,7 +278,7 @@ void disposeChain(oscar_tlv_chain **chain)
*chain = NULL;
}
-oscar_tlv_record_list* readIntoTLVRecordList(BYTE **buf, WORD wLen, int nCount)
+oscar_tlv_record_list* readIntoTLVRecordList(BYTE **buf, size_t wLen, int nCount)
{
oscar_tlv_record_list *list = NULL, *last;