erpt: actually support non-sequential ids, nintendo why

This commit is contained in:
Michael Scire authored and SciresM committed 2024-03-29 02:41:14 -07:00
1 parent b081762657
commit 551821e7e2
7 files changed
+91 -36

No files matched your search

@@ -62,7 +62,10 @@ namespace ams::erpt::srv {
static Result AddId(Report *report, FieldId field_id) {
static_assert(MaxFieldStringSize < ElementSize_256);
R_TRY(AddStringValue(report, FieldString[field_id], strnlen(FieldString[field_id], MaxFieldStringSize)));
const auto index = FindFieldIndex(field_id);
AMS_ASSERT(index.has_value());
R_TRY(AddStringValue(report, FieldString[index.value()], strnlen(FieldString[index.value()], MaxFieldStringSize)));
R_SUCCEED();
}