From 6f29237b788abb17a498ac7dbe56815818b86c60 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Sat, 17 Aug 2024 16:23:38 +0100 Subject: [PATCH] [*] AuFS::ReadString shouldn't fail with an empty file --- Source/IO/FS/FS.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/IO/FS/FS.cpp b/Source/IO/FS/FS.cpp index ff0104c6..d6627f10 100644 --- a/Source/IO/FS/FS.cpp +++ b/Source/IO/FS/FS.cpp @@ -353,6 +353,12 @@ namespace Aurora::IO::FS return false; } + if (fileBuffer.IsEmpty()) + { + buffer.clear(); + return true; + } + return Locale::Encoding::DecodeUTF8(fileBuffer.data(), fileBuffer.size(), buffer, Locale::ECodePage::eUTF8).first != 0; }