From 86ed199054faf892eed09401234ae7350848270c Mon Sep 17 00:00:00 2001 From: fgsfds Date: Thu, 28 Sep 2023 09:05:11 +0200 Subject: [PATCH] port: fix external seg loading --- port/src/romdata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/port/src/romdata.c b/port/src/romdata.c index 2bc02469f..cb4fd2c89 100644 --- a/port/src/romdata.c +++ b/port/src/romdata.c @@ -219,11 +219,11 @@ static inline void romdataInitSegment(struct romfile *seg) } // check if we have an external replacement and load it if so + char tmp[FS_MAXPATH]; + snprintf(tmp, sizeof(tmp), ROMDATA_SEGDIR "/%s", seg->name); u8 *newData = NULL; - const s32 extFileSize = fsFileSize(seg->name); + const s32 extFileSize = fsFileSize(tmp); if (extFileSize > 0) { - char tmp[FS_MAXPATH]; - snprintf(tmp, sizeof(tmp), ROMDATA_SEGDIR "/%s", seg->name); newData = fsFileLoad(tmp, &seg->size); }