aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/vfs.cpp
diff options
context:
space:
mode:
authorRodrigo Locatti <reinuseslisp@airmail.cc>2020-09-22 23:37:51 +0000
committerGitHub <noreply@github.com>2020-09-22 23:37:51 +0000
commit43a7e8a2ebf95a024463e165bb867cb4a8750101 (patch)
tree288ff1cc4677d6511ed8cc7e1b0db20ce2d2590f /src/core/file_sys/vfs.cpp
parentf3b0c1b4b54c132ee24783c35db6bf4c6264622b (diff)
parente457001dced3b86c89e842270c6ed0513e81027f (diff)
Merge pull request #4698 from lioncash/optional-null
General: Make use of std::nullopt where applicable
Diffstat (limited to 'src/core/file_sys/vfs.cpp')
-rw-r--r--src/core/file_sys/vfs.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/file_sys/vfs.cpp b/src/core/file_sys/vfs.cpp
index a4c3f67c4a..b2f026b6de 100644
--- a/src/core/file_sys/vfs.cpp
+++ b/src/core/file_sys/vfs.cpp
@@ -169,11 +169,12 @@ VfsDirectory::~VfsDirectory() = default;
std::optional<u8> VfsFile::ReadByte(std::size_t offset) const {
u8 out{};
- std::size_t size = Read(&out, 1, offset);
- if (size == 1)
+ const std::size_t size = Read(&out, sizeof(u8), offset);
+ if (size == 1) {
return out;
+ }
- return {};
+ return std::nullopt;
}
std::vector<u8> VfsFile::ReadBytes(std::size_t size, std::size_t offset) const {