diff options
author | Benjamin Dobell <benjamin.dobell+git@glassechidna.com.au> | 2014-06-01 14:09:56 +1000 |
---|---|---|
committer | Benjamin Dobell <benjamin.dobell+git@glassechidna.com.au> | 2014-06-01 14:09:56 +1000 |
commit | 082fb091f1a0cab9d00e82de54fee32b6a1c0c7b (patch) | |
tree | a3e73e4d8b2279c3221a297ac770c96ef92175e2 /heimdall/source/SendFilePartPacket.h | |
parent | 46d9a51e18d260e416479432fec50c6e601eb3ce (diff) | |
download | external_heimdall-082fb091f1a0cab9d00e82de54fee32b6a1c0c7b.zip external_heimdall-082fb091f1a0cab9d00e82de54fee32b6a1c0c7b.tar.gz external_heimdall-082fb091f1a0cab9d00e82de54fee32b6a1c0c7b.tar.bz2 |
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.
Diffstat (limited to 'heimdall/source/SendFilePartPacket.h')
-rw-r--r-- | heimdall/source/SendFilePartPacket.h | 8 |
1 files changed, 4 insertions, 4 deletions
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;
|