diff options
Diffstat (limited to 'protocols/Tox/src')
-rw-r--r-- | protocols/Tox/src/tox_transfer.cpp | 4 |
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);
|