From 082fb091f1a0cab9d00e82de54fee32b6a1c0c7b Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Sun, 1 Jun 2014 14:09:56 +1000 Subject: Fixed support for large files (up to 2^32 - 1 bytes) The Loke protocol supports 32-bit unsigned for the size of files being flashed. However, POSIX file commands only support 32-bit (signed). As such we now have platform specific support for larger files. --- heimdall/source/SendFilePartPacket.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'heimdall/source/SendFilePartPacket.h') diff --git a/heimdall/source/SendFilePartPacket.h b/heimdall/source/SendFilePartPacket.h index 3ecaa89..38e9dbe 100644 --- a/heimdall/source/SendFilePartPacket.h +++ b/heimdall/source/SendFilePartPacket.h @@ -38,11 +38,11 @@ namespace Heimdall { memset(data, 0, size); - long position = ftell(file); + unsigned int position = (unsigned int)FileTell(file); - fseek(file, 0, SEEK_END); - long fileSize = ftell(file); - fseek(file, position, SEEK_SET); + FileSeek(file, 0, SEEK_END); + unsigned int fileSize = (unsigned int)FileTell(file); + FileSeek(file, position, SEEK_SET); // min(fileSize, size) unsigned int bytesToRead = (fileSize < size) ? fileSize - position : size; -- cgit v1.2.3