Minor stuff/fixes

This commit is contained in:
Aurora Wright 2017-05-08 01:11:24 +02:00
parent 540c0df918
commit 033d90b866
6 changed files with 11 additions and 9 deletions

View File

@ -30,9 +30,8 @@
#include "screen.h" #include "screen.h"
#include "utils.h" #include "utils.h"
#include "fs.h" #include "fs.h"
#include "font.h"
#include <stdarg.h>
#include "fmt.h" #include "fmt.h"
#include "font.h"
bool loadSplash(void) bool loadSplash(void)
{ {

View File

@ -326,10 +326,10 @@ static inline void copySection0AndInjectSystemModules(FirmwareType firmType, boo
if(loadFromStorage) if(loadFromStorage)
{ {
char fileName[64]; char fileName[24];
//Read modules from files if they exist //Read modules from files if they exist
sprintf(fileName, "%.8s.cxi", moduleName); sprintf(fileName, "sysmodules/%.8s.cxi", moduleName);
dstModuleSize = getFileSize(fileName); dstModuleSize = getFileSize(fileName);
@ -349,7 +349,7 @@ static inline void copySection0AndInjectSystemModules(FirmwareType firmType, boo
const u8 *module; const u8 *module;
if(firmType == NATIVE_FIRM && memcmp(moduleName, "loader", 6 + 1) == 0) if(firmType == NATIVE_FIRM && memcmp(moduleName, "loader", 6) == 0)
{ {
module = injector_bin; module = injector_bin;
dstModuleSize = injector_bin_size; dstModuleSize = injector_bin_size;

View File

@ -142,7 +142,7 @@ void loadPayload(u32 pressed, const char *payloadPath)
DIR dir; DIR dir;
FILINFO info; FILINFO info;
FRESULT result; FRESULT result;
char path[128]; char path[22];
result = f_findfirst(&dir, &info, "payloads", pattern); result = f_findfirst(&dir, &info, "payloads", pattern);
@ -272,8 +272,9 @@ u32 firmRead(void *dest, u32 firmType)
{"00000003", "20000003"}, {"00000003", "20000003"},
{"00000001", "20000001"}}; {"00000001", "20000001"}};
char folderPath[48]; char folderPath[35],
char path[48]; path[48];
sprintf(folderPath, "1:/title/00040138/%s/content", firmFolders[firmType][ISN3DS ? 1 : 0]); sprintf(folderPath, "1:/title/00040138/%s/content", firmFolders[firmType][ISN3DS ? 1 : 0]);
DIR dir; DIR dir;

View File

@ -264,7 +264,7 @@ boot:
if(res != 0) if(res != 0)
{ {
char patchesError[64]; char patchesError[43];
sprintf(patchesError, "Failed to apply %u FIRM patch(es).", res); sprintf(patchesError, "Failed to apply %u FIRM patch(es).", res);
error(patchesError); error(patchesError);
} }

View File

@ -35,6 +35,7 @@ u32 strlen(const char *string)
u32 strnlen(const char *string, u32 maxlen) u32 strnlen(const char *string, u32 maxlen)
{ {
u32 size; u32 size;
for(size = 0; size < maxlen && *string; string++, size++); for(size = 0; size < maxlen && *string; string++, size++);
return size; return size;

View File

@ -25,6 +25,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdarg.h>
//Common data types //Common data types
typedef uint8_t u8; typedef uint8_t u8;