From f9bc98a356a0657a548bebb4b7b31e6c05304f49 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 22 Feb 2024 14:45:16 +0300 Subject: fixes #4206 (ICQ: fix for a broken multiple file transfer) --- protocols/ICQ-WIM/src/proto.cpp | 9 +++++---- 1 file 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; -- cgit v1.2.3