summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-22 14:25:21 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-22 14:25:21 +0300
commitb7a1b2a410469078ee6bc46e959a427258a6f356 (patch)
tree8d717179274b4802a960e41bc8b1e4ccc24f3389
parent6295019e2dc2e8ba809178bddd2e646bf3127683 (diff)
IcqCorp: outgoing file transfers go with wrong utf-8 filenames
-rw-r--r--protocols/ICQCorp/src/protocol.cpp6
-rw-r--r--protocols/ICQCorp/src/transfer.cpp7
2 files changed, 6 insertions, 7 deletions
diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp
index 067baf4ddf..6f79c47cd6 100644
--- a/protocols/ICQCorp/src/protocol.cpp
+++ b/protocols/ICQCorp/src/protocol.cpp
@@ -1547,13 +1547,13 @@ ICQTransfer *ICQ::sendFile(ICQUser *u, char *description, char *filename, unsign
if (!u->socket.connected() && !openConnection(u->socket))
return nullptr;
- unsigned int i;
-
ICQTransfer *transfer = new ICQTransfer(u, tcpSequenceVal);
+ int i;
for (i = 0; files[i]; i++);
transfer->files = new wchar_t*[i + 1];
- for (i = 0; files[i]; i++) transfer->files[i] = _wcsdup(files[i]);
+ for (i = 0; files[i]; i++)
+ transfer->files[i] = _wcsdup(files[i]);
transfer->files[i] = nullptr;
transfer->description = _strdup(description);
diff --git a/protocols/ICQCorp/src/transfer.cpp b/protocols/ICQCorp/src/transfer.cpp
index f8b42e5b87..a13f961a43 100644
--- a/protocols/ICQCorp/src/transfer.cpp
+++ b/protocols/ICQCorp/src/transfer.cpp
@@ -228,8 +228,8 @@ void ICQTransfer::sendPacket0x02()
Packet packet;
packet << (unsigned char)0x02
<< directory
- << ptrA(mir_utf8encodeW(wcsrchr(fileName, '\\') + 1)).get()
- << ptrA(mir_utf8encodeW(directoryName + mir_wstrlen(path) + 1)).get()
+ << _T2A(wcsrchr(fileName, '\\') + 1)
+ << _T2A(directoryName + mir_wstrlen(path) + 1)
<< fileSize
<< fileDate
<< speed;
@@ -327,8 +327,7 @@ void ICQTransfer::ack(unsigned int result)
ProtoBroadcastAck(protoName, hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, this, 0);
socket.closeConnection();
- unsigned int i;
- for (i = 0; i < icqTransfers.size(); i++) {
+ for (size_t i = 0; i < icqTransfers.size(); i++) {
if (icqTransfers[i] == this) {
delete icqTransfers[i];
icqTransfers[i] = icqTransfers[icqTransfers.size() - 1];