From 66c041ad93fcfbaeef0928d9d50884f033577801 Mon Sep 17 00:00:00 2001 From: Aurora Date: Mon, 10 Oct 2016 18:56:19 +0200 Subject: [PATCH] Minor stuff --- source/firm.c | 6 +++--- source/fs.c | 2 +- source/main.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/firm.c b/source/firm.c index f856897..cfa5657 100755 --- a/source/firm.c +++ b/source/firm.c @@ -51,12 +51,12 @@ u32 loadFirm(FirmwareType *firmType, FirmwareSource nandType, bool loadFromStora "luma/cetk_safe" }; - if(isSdMode && !mountFs(false)) error("Error mounting CTRNAND."); + if(isSdMode && !mountFs(false)) error("Failed to mount CTRNAND."); //Load FIRM from CTRNAND u32 firmVersion = firmRead(firm, (u32)*firmType); - if(firmVersion == 0xFFFFFFFF) error("Error getting the CTRNAND FIRM."); + if(firmVersion == 0xFFFFFFFF) error("Failed to get the CTRNAND FIRM."); bool mustLoadFromStorage = false; @@ -79,7 +79,7 @@ u32 loadFirm(FirmwareType *firmType, FirmwareSource nandType, bool loadFromStora if(loadFromStorage || mustLoadFromStorage) { - u32 firmSize = fileRead(firm, *firmType == NATIVE_FIRM1X2X ? firmwareFiles[0] : firmwareFiles[(u32)*firmType], 0x400000); + u32 firmSize = fileRead(firm, *firmType == NATIVE_FIRM1X2X ? firmwareFiles[0] : firmwareFiles[(u32)*firmType], 0x400200); if(firmSize > sizeof(Cxi)) { diff --git a/source/fs.c b/source/fs.c index be84ebd..4a45379 100644 --- a/source/fs.c +++ b/source/fs.c @@ -203,7 +203,7 @@ u32 firmRead(void *dest, u32 firmType) //Convert back the .app name from integer to array hexItoa(firmVersion, path + 35, 8, false); - if(!fileRead(dest, path, 0x400200)) firmVersion = 0xFFFFFFFF; + if(fileRead(dest, path, 0x400200) <= sizeof(Cxi)) firmVersion = 0xFFFFFFFF; } } diff --git a/source/main.c b/source/main.c index e86b68c..8dd594c 100644 --- a/source/main.c +++ b/source/main.c @@ -48,7 +48,7 @@ void main(void) else { firmSource = FIRMWARE_SYSNAND; - if(!mountFs(false) || !switchToCtrNand()) error("Error mounting SD and CTRNAND."); + if(!mountFs(false) || !switchToCtrNand()) error("Failed to mount SD and CTRNAND."); isSdMode = false; }