summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/icq_filetransfer.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-11-30 16:44:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-11-30 16:44:58 +0000
commit237d02ebbabbedfb8b33160ebfb5250bbd491eca (patch)
treeb849e272002724c24da02b6e4b714bdf9281a34b /protocols/IcqOscarJ/src/icq_filetransfer.cpp
parentf485b5e4b683cc31168d440dc89574913e814852 (diff)
and a few more
git-svn-id: http://svn.miranda-ng.org/main/trunk@11174 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src/icq_filetransfer.cpp')
-rw-r--r--protocols/IcqOscarJ/src/icq_filetransfer.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/protocols/IcqOscarJ/src/icq_filetransfer.cpp b/protocols/IcqOscarJ/src/icq_filetransfer.cpp
index df3ffa8c20..32df7bae33 100644
--- a/protocols/IcqOscarJ/src/icq_filetransfer.cpp
+++ b/protocols/IcqOscarJ/src/icq_filetransfer.cpp
@@ -292,7 +292,7 @@ void CIcqProto::handleFileTransferPacket(directconnect* dc, PBYTE buf, size_t wL
DWORD dwFileCount;
DWORD dwTotalSize;
DWORD dwTransferSpeed;
- WORD wNickLength;
+ size_t wNickLength;
int bAdded;
unpackLEDWord(&buf, &dwFileCount);
@@ -337,16 +337,15 @@ void CIcqProto::handleFileTransferPacket(directconnect* dc, PBYTE buf, size_t wL
return;
buf++; /* id */
{
- char *szAnsi;
- WORD wThisFilenameLen, wSubdirLen;
+ size_t wThisFilenameLen, wSubdirLen;
BYTE isDirectory;
-
unpackByte(&buf, &isDirectory);
unpackLEWord(&buf, &wThisFilenameLen);
if (wLen < 19 + wThisFilenameLen)
return;
+
SAFE_FREE(&dc->ft->szThisFile);
- szAnsi = (char *)_alloca(wThisFilenameLen + 1);
+ char *szAnsi = (char *)_alloca(wThisFilenameLen + 1);
memcpy(szAnsi, buf, wThisFilenameLen);
szAnsi[wThisFilenameLen] = '\0';
dc->ft->szThisFile = ansi_to_utf8(szAnsi);