diff options
author | George Hazan <george.hazan@gmail.com> | 2024-02-22 14:45:16 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-02-22 14:45:16 +0300 |
commit | f9bc98a356a0657a548bebb4b7b31e6c05304f49 (patch) | |
tree | c6de3b3c2a309ca0720db6bf972a63c94e0a08fd | |
parent | 98783b0d413e1021bcba6e3299c355ffd18ae160 (diff) |
fixes #4206 (ICQ: fix for a broken multiple file transfer)
-rw-r--r-- | protocols/ICQ-WIM/src/proto.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index 9e5a57220d..805f75ea2e 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -574,17 +574,18 @@ HANDLE CIcqProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, wcha IcqFileTransfer *pTransfer = nullptr;
for (int i = 0; ppszFiles[i] != 0; i++) {
+ auto *pwszFileName = ppszFiles[i];
struct _stat statbuf;
- if (_wstat(ppszFiles[0], &statbuf)) {
- debugLogW(L"'%s' is an invalid filename", ppszFiles[i]);
+ if (_wstat(pwszFileName, &statbuf)) {
+ debugLogW(L"'%s' is an invalid filename", pwszFileName);
continue;
}
- int iFileId = _wopen(ppszFiles[i], _O_RDONLY | _O_BINARY, _S_IREAD);
+ int iFileId = _wopen(pwszFileName, _O_RDONLY | _O_BINARY, _S_IREAD);
if (iFileId < 0)
continue;
- pTransfer = new IcqFileTransfer(hContact, ppszFiles[i]);
+ pTransfer = new IcqFileTransfer(hContact, pwszFileName);
pTransfer->pfts.totalFiles = 1;
pTransfer->pfts.currentFileSize = pTransfer->pfts.totalBytes = statbuf.st_size;
pTransfer->m_fileId = iFileId;
|