summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/cfg/cfg.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp
index 1a2104b48..71986f7d2 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -43,13 +43,18 @@ ResultCode GetConfigInfoBlock(u32 block_id, u32 size, u32 flag, u8* output) {
43 SaveFileConfig* config = reinterpret_cast<SaveFileConfig*>(cfg_config_file_buffer.data()); 43 SaveFileConfig* config = reinterpret_cast<SaveFileConfig*>(cfg_config_file_buffer.data());
44 44
45 auto itr = std::find_if(std::begin(config->block_entries), std::end(config->block_entries), 45 auto itr = std::find_if(std::begin(config->block_entries), std::end(config->block_entries),
46 [&](const SaveConfigBlockEntry& entry) { 46 [&](const SaveConfigBlockEntry& entry) {
47 return entry.block_id == block_id && entry.size == size && (entry.flags & flag); 47 return entry.block_id == block_id && (entry.flags & flag);
48 }); 48 });
49 49
50 if (itr == std::end(config->block_entries)) { 50 if (itr == std::end(config->block_entries)) {
51 LOG_ERROR(Service_CFG, "Config block %u with size %u and flags %u not found", block_id, size, flag); 51 LOG_ERROR(Service_CFG, "Config block %u with flags %u was not found", block_id, flag);
52 return ResultCode(-1); // TODO(Subv): Find the correct error code 52 return ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent);
53 }
54
55 if (itr->size != size) {
56 LOG_ERROR(Service_CFG, "Invalid size %u for config block %u with flags %u", size, block_id, flag);
57 return ResultCode(ErrorDescription::InvalidSize, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent);
53 } 58 }
54 59
55 // The data is located in the block header itself if the size is less than 4 bytes 60 // The data is located in the block header itself if the size is less than 4 bytes