port: fix external seg loading

This commit is contained in:
fgsfds committed 2023-09-28 09:05:11 +02:00
1 parent 466c77362e
commit 86ed199054
1 file changed
+3 -3
+3 -3
View File
@@ -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);
}