summaryrefslogtreecommitdiffstats
path: root/heimdall/source/PrintPitAction.cpp
diff options
context:
space:
mode:
authorBenjamin Dobell <benjamin.dobell+git@glassechidna.com.au>2014-06-01 06:09:56 +0200
committerBenjamin Dobell <benjamin.dobell+git@glassechidna.com.au>2014-06-01 06:09:56 +0200
commit082fb091f1a0cab9d00e82de54fee32b6a1c0c7b (patch)
treea3e73e4d8b2279c3221a297ac770c96ef92175e2 /heimdall/source/PrintPitAction.cpp
parentFixed file transfer sequence bug (diff)
downloadHeimdall-082fb091f1a0cab9d00e82de54fee32b6a1c0c7b.tar
Heimdall-082fb091f1a0cab9d00e82de54fee32b6a1c0c7b.tar.gz
Heimdall-082fb091f1a0cab9d00e82de54fee32b6a1c0c7b.tar.bz2
Heimdall-082fb091f1a0cab9d00e82de54fee32b6a1c0c7b.tar.lz
Heimdall-082fb091f1a0cab9d00e82de54fee32b6a1c0c7b.tar.xz
Heimdall-082fb091f1a0cab9d00e82de54fee32b6a1c0c7b.tar.zst
Heimdall-082fb091f1a0cab9d00e82de54fee32b6a1c0c7b.zip
Diffstat (limited to 'heimdall/source/PrintPitAction.cpp')
-rw-r--r--heimdall/source/PrintPitAction.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/heimdall/source/PrintPitAction.cpp b/heimdall/source/PrintPitAction.cpp
index 781973d..12c28d1 100644
--- a/heimdall/source/PrintPitAction.cpp
+++ b/heimdall/source/PrintPitAction.cpp
@@ -115,7 +115,7 @@ int PrintPitAction::Execute(int argc, char **argv)
{
const char *filename = fileArgument->GetValue().c_str();
- localPitFile = fopen(filename, "rb");
+ localPitFile = FileOpen(filename, "rb");
if (!localPitFile)
{
@@ -133,14 +133,14 @@ int PrintPitAction::Execute(int argc, char **argv)
{
// Print PIT from file; there's no need for a BridgeManager.
- fseek(localPitFile, 0, SEEK_END);
- long localPitFileSize = ftell(localPitFile);
- rewind(localPitFile);
+ FileSeek(localPitFile, 0, SEEK_END);
+ unsigned int localPitFileSize = (unsigned int)FileTell(localPitFile);
+ FileRewind(localPitFile);
// Load the local pit file into memory.
unsigned char *pitFileBuffer = new unsigned char[localPitFileSize];
size_t dataRead = fread(pitFileBuffer, 1, localPitFileSize, localPitFile); // dataRead is discarded, it's here to remove warnings.
- fclose(localPitFile);
+ FileClose(localPitFile);
PitData *pitData = new PitData();
pitData->Unpack(pitFileBuffer);