summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2015-03-09 15:44:34 -0400
committerGravatar bunnei2015-03-09 15:44:34 -0400
commit8a1cc5b8058686e9c73a363f22c48c4a3d10d4ec (patch)
treee6ca78f34ec9359cba2efa4b5678a32ca29c6710 /src
parentMerge pull request #634 from linkmauve/logging-performances (diff)
parentFix error message for bad config block request. (diff)
downloadyuzu-8a1cc5b8058686e9c73a363f22c48c4a3d10d4ec.tar.gz
yuzu-8a1cc5b8058686e9c73a363f22c48c4a3d10d4ec.tar.xz
yuzu-8a1cc5b8058686e9c73a363f22c48c4a3d10d4ec.zip
Merge pull request #589 from kevinhartman/config-errors
Fix errorcodes for bad config block request
Diffstat (limited to 'src')
-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 1eb2562d8..6adadb224 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -48,13 +48,18 @@ ResultCode GetConfigInfoBlock(u32 block_id, u32 size, u32 flag, u8* output) {
48 SaveFileConfig* config = reinterpret_cast<SaveFileConfig*>(cfg_config_file_buffer.data()); 48 SaveFileConfig* config = reinterpret_cast<SaveFileConfig*>(cfg_config_file_buffer.data());
49 49
50 auto itr = std::find_if(std::begin(config->block_entries), std::end(config->block_entries), 50 auto itr = std::find_if(std::begin(config->block_entries), std::end(config->block_entries),
51 [&](const SaveConfigBlockEntry& entry) { 51 [&](const SaveConfigBlockEntry& entry) {
52 return entry.block_id == block_id && entry.size == size && (entry.flags & flag); 52 return entry.block_id == block_id && (entry.flags & flag);
53 }); 53 });
54 54
55 if (itr == std::end(config->block_entries)) { 55 if (itr == std::end(config->block_entries)) {
56 LOG_ERROR(Service_CFG, "Config block %u with size %u and flags %u not found", block_id, size, flag); 56 LOG_ERROR(Service_CFG, "Config block %u with flags %u was not found", block_id, flag);
57 return ResultCode(-1); // TODO(Subv): Find the correct error code 57 return ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent);
58 }
59
60 if (itr->size != size) {
61 LOG_ERROR(Service_CFG, "Invalid size %u for config block %u with flags %u", size, block_id, flag);
62 return ResultCode(ErrorDescription::InvalidSize, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent);
58 } 63 }
59 64
60 // The data is located in the block header itself if the size is less than 4 bytes 65 // The data is located in the block header itself if the size is less than 4 bytes