From 42cbead456857695f4a9d915eaba16c0507b4e10 Mon Sep 17 00:00:00 2001 From: Aurora Date: Sat, 5 Mar 2016 16:16:25 +0100 Subject: [PATCH] Remove redundancies --- source/firm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/firm.c b/source/firm.c index 4e87948..bc55048 100755 --- a/source/firm.c +++ b/source/firm.c @@ -27,6 +27,7 @@ char *firmPathPatched = NULL; void setupCFW(void){ u8 overrideConfig = 0; + char lastConfigPath[] = "rei/lastbootcfg"; //Detect the console being used if(PDN_MPCORE_CFG == 1) console = 0; @@ -42,9 +43,9 @@ void setupCFW(void){ } //If using A9LH and it's a MCU reboot, try to force boot options - if(a9lhSetup && *(u8*)0x10010000 && fileExists("rei/lastbootcfg")){ + if(a9lhSetup && *(u8*)0x10010000 && fileExists(lastConfigPath)){ u8 tempConfig; - fileRead((u8*)&tempConfig, "rei/lastbootcfg", 1); + fileRead((u8*)&tempConfig, lastConfigPath, 1); //Always force a sysNAND boot when quitting AGB_FIRM if(*(u8*)0x10010000 == 0x7) { @@ -73,7 +74,7 @@ void setupCFW(void){ //Write the current boot options on A9LH if(a9lhSetup){ u8 tempConfig = (mode | (emuNAND << 1)) & 0x3; - fileWrite((u8*)&tempConfig, "rei/lastbootcfg", 1); + fileWrite((u8*)&tempConfig, lastConfigPath, 1); } } @@ -206,7 +207,7 @@ u8 patchFirm(void){ fOpenOffset = 0; //Read reboot code from SD - char *path = "/rei/reboot/reboot.bin"; + char path[] = "/rei/reboot/reboot.bin"; u32 size = fileSize(path); if (!size) return 1; getReboot(firmLocation, firmSize, &rebootOffset);