From b5f72b9f20e0f4af62a5c62dccdda070736a736e Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 28 Jan 2021 14:28:45 -0800 Subject: [PATCH] fssystem: fix bug in BufferedStorage --- .../source/fssystem/save/fssystem_buffered_storage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/libstratosphere/source/fssystem/save/fssystem_buffered_storage.cpp b/libraries/libstratosphere/source/fssystem/save/fssystem_buffered_storage.cpp index c43e06f3e..aff6b45b3 100644 --- a/libraries/libstratosphere/source/fssystem/save/fssystem_buffered_storage.cpp +++ b/libraries/libstratosphere/source/fssystem/save/fssystem_buffered_storage.cpp @@ -899,7 +899,7 @@ namespace ams::fssystem::save { const s64 cur_offset_end = offset + *size; size_t cur_size = 0; - if (!util::IsAligned(offset, this->block_size)) { + if (!util::IsAligned(cur_offset_end, this->block_size)) { const s64 aligned_size = cur_offset_end - util::AlignDown(cur_offset_end, this->block_size); cur_size = std::min(aligned_size, static_cast(*size)); } else if (*size < this->block_size) {