From 7a5716c443e5613ece382f09c9dd01d9837a5d3f Mon Sep 17 00:00:00 2001 From: Aetias Date: Thu, 22 Feb 2024 18:24:49 +0100 Subject: [PATCH] Use `ChangeDir` in `files.h` --- tools/rom/files.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/rom/files.h b/tools/rom/files.h index 6284ed6e..176fc29f 100644 --- a/tools/rom/files.h +++ b/tools/rom/files.h @@ -80,7 +80,7 @@ bool _FileTreeFileCallback(const char *name, bool isDir, void *userData) { memcpy(entry->name, name, nameLength); WRITE_SUBDIR_ID(entry, 0); - if (chdir(name) != 0) FATAL("Failed to enter directory '%s'\n", name); + if (!ChangeDir(name)) return false; FileTree child; if (!MakeFileTree(&child)) return false; @@ -89,7 +89,7 @@ bool _FileTreeFileCallback(const char *name, bool isDir, void *userData) { memcpy(&pTree->children[pTree->numChildren], &child, sizeof(child)); pTree->numChildren += 1; - if (chdir("..") != 0) FATAL("Failed to leave directory '%s'\n", name); + if (!ChangeDir("..")) return false; } else { FntSubEntry *entry = malloc(sizeof(FntSubEntry) + nameLength); if (entry == NULL) FATAL("Failed to allocate FNT sub entry for file '%s'\n", name);