summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_transfer.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-08-12 19:20:05 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-08-12 19:20:05 +0000
commita8576d3bb481188eb63910f412edefa94b1b5b52 (patch)
tree99c7e7b6ca2b324f24f051bb6c36f356f29d6cd0 /protocols/Tox/src/tox_transfer.cpp
parente530b1be3a65296d2324b2299897367ee14d4a3d (diff)
Tox: transfer fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@14927 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_transfer.cpp')
-rw-r--r--protocols/Tox/src/tox_transfer.cpp4
1 files changed, 4 insertions, 0 deletions
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);