diff --git a/libraries/libstratosphere/include/stratosphere/fssystem/fssystem_sparse_storage.hpp b/libraries/libstratosphere/include/stratosphere/fssystem/fssystem_sparse_storage.hpp index 89b0773eb..1a1c3f1a9 100644 --- a/libraries/libstratosphere/include/stratosphere/fssystem/fssystem_sparse_storage.hpp +++ b/libraries/libstratosphere/include/stratosphere/fssystem/fssystem_sparse_storage.hpp @@ -29,42 +29,42 @@ namespace ams::fssystem { public: ZeroStorage() { /* ... */ } virtual ~ZeroStorage() { /* ... */ } + public: + virtual Result Read(s64 offset, void *buffer, size_t size) override { + AMS_ASSERT(offset >= 0); + AMS_ASSERT(buffer != nullptr || size == 0); + AMS_UNUSED(offset); - virtual Result Read(s64 offset, void *buffer, size_t size) override { - AMS_ASSERT(offset >= 0); - AMS_ASSERT(buffer != nullptr || size == 0); - AMS_UNUSED(offset); - - if (size > 0) { - std::memset(buffer, 0, size); + if (size > 0) { + std::memset(buffer, 0, size); + } + R_SUCCEED(); } - R_SUCCEED(); - } - virtual Result OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override { - AMS_UNUSED(dst, dst_size, op_id, offset, size, src, src_size); - R_SUCCEED(); - } + virtual Result OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override { + AMS_UNUSED(dst, dst_size, op_id, offset, size, src, src_size); + R_SUCCEED(); + } - virtual Result GetSize(s64 *out) override { - AMS_ASSERT(out != nullptr); - *out = std::numeric_limits::max(); - R_SUCCEED(); - } + virtual Result GetSize(s64 *out) override { + AMS_ASSERT(out != nullptr); + *out = std::numeric_limits::max(); + R_SUCCEED(); + } - virtual Result Flush() override { - R_SUCCEED(); - } + virtual Result Flush() override { + R_SUCCEED(); + } - virtual Result Write(s64 offset, const void *buffer, size_t size) override { - AMS_UNUSED(offset, buffer, size); - R_THROW(fs::ResultUnsupportedWriteForZeroStorage()); - } + virtual Result Write(s64 offset, const void *buffer, size_t size) override { + AMS_UNUSED(offset, buffer, size); + R_THROW(fs::ResultUnsupportedWriteForZeroStorage()); + } - virtual Result SetSize(s64 size) override { - AMS_UNUSED(size); - R_THROW(fs::ResultUnsupportedSetSizeForZeroStorage()); - } + virtual Result SetSize(s64 size) override { + AMS_UNUSED(size); + R_THROW(fs::ResultUnsupportedSetSizeForZeroStorage()); + } }; private: ZeroStorage m_zero_storage; diff --git a/libraries/libstratosphere/source/fssystem/fssystem_nca_reader.cpp b/libraries/libstratosphere/source/fssystem/fssystem_nca_reader.cpp index 815fa021e..5ea29cd35 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_nca_reader.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_nca_reader.cpp @@ -143,7 +143,7 @@ namespace ams::fssystem { /* Check if we have a rights id. */ constexpr const u8 ZeroRightsId[NcaHeader::RightsIdSize] = {}; if (crypto::IsSameBytes(ZeroRightsId, m_header.rights_id, NcaHeader::RightsIdSize)) { - /* If we do, then we don't have an external key, so we need to generate decryption keys if software keys are available. */ + /* If we don't, then we don't have an external key, so we need to generate decryption keys if software keys are available. */ if (crypto_cfg.is_available_sw_key) { crypto_cfg.generate_key(m_decryption_keys[NcaHeader::DecryptionKey_AesCtr], crypto::AesDecryptor128::KeySize, m_header.encrypted_key_area + NcaHeader::DecryptionKey_AesCtr * crypto::AesDecryptor128::KeySize, crypto::AesDecryptor128::KeySize, GetKeyTypeValue(m_header.key_index, m_header.GetProperKeyGeneration()));