diff options
Diffstat (limited to 'zencore/filesystem.cpp')
| -rw-r--r-- | zencore/filesystem.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp index f842cbfea..7a1f6c336 100644 --- a/zencore/filesystem.cpp +++ b/zencore/filesystem.cpp @@ -548,7 +548,9 @@ ReadFile(std::filesystem::path Path) int Fd = open(Path.c_str(), O_RDONLY); if (Fd < 0) { - return FileContents{.ErrorCode = std::error_code(zen::GetLastError(), std::system_category())}; + FileContents Ret; + Ret.ErrorCode = std::error_code(zen::GetLastError(), std::system_category()); + return Ret; } static_assert(sizeof(decltype(stat::st_size)) == sizeof(uint64_t), "fstat() doesn't support large files"); @@ -707,7 +709,7 @@ FileSystemTraversal::TraverseFileSystem(const std::filesystem::path& RootDir, Tr ThrowLastError("Failed to open directory for traversal: {}"_format(RootDir.c_str())); } - for (struct dirent* Entry; Entry = readdir(Dir);) + for (struct dirent* Entry; (Entry = readdir(Dir));) { const char* FileName = Entry->d_name; |