From a8576d3bb481188eb63910f412edefa94b1b5b52 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 12 Aug 2015 19:20:05 +0000 Subject: Tox: transfer fix git-svn-id: http://svn.miranda-ng.org/main/trunk@14927 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_transfer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'protocols/Tox/src') diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp index b74ac1ca53..7b61637cff 100644 --- a/protocols/Tox/src/tox_transfer.cpp +++ b/protocols/Tox/src/tox_transfer.cpp @@ -173,6 +173,10 @@ void CToxProto::OnDataReceiving(Tox*, uint32_t friendNumber, uint32_t fileNumber return; } + uint64_t filePos = _ftelli64(transfer->hFile); + if (filePos != position) + _fseeki64(transfer->hFile, position, SEEK_SET); + if (fwrite(data, sizeof(uint8_t), length, transfer->hFile) != length) { proto->debugLogA(__FUNCTION__": failed write to file (%d)", fileNumber); -- cgit v1.2.3