diff options
Diffstat (limited to 'protocols/IcqOscarJ/src/icq_rates.cpp')
-rw-r--r-- | protocols/IcqOscarJ/src/icq_rates.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/protocols/IcqOscarJ/src/icq_rates.cpp b/protocols/IcqOscarJ/src/icq_rates.cpp index 5c2f857bbd..5d4c5740cd 100644 --- a/protocols/IcqOscarJ/src/icq_rates.cpp +++ b/protocols/IcqOscarJ/src/icq_rates.cpp @@ -76,18 +76,21 @@ rates::rates(CIcqProto *ppro, BYTE *pBuffer, size_t wLen) // Parse Group associated pairs
for (i = 0; i < wCount; i++) {
rates_group *pGroup = &groups[i];
- WORD wNum;
- if (wLen < 4) break;
+ if (wLen < 4)
+ break;
+
pBuffer += 2; // Group ID
+ WORD wNum;
unpackWord(&pBuffer, &wNum);
wLen -= 4;
- if (wLen < wNum * 4) break;
+ if (wLen < (size_t)wNum * 4)
+ break;
+
pGroup->nPairs = wNum;
pGroup->pPairs = (WORD*)SAFE_MALLOC(wNum * 4);
- for (int n = 0; n < wNum * 2; n++) {
+ for (size_t n = 0; n < (size_t)wNum * 2; n++) {
WORD wItem;
-
unpackWord(&pBuffer, &wItem);
pGroup->pPairs[n] = wItem;
}
|