libstrat: fix bugs/compiler warnings
This commit is contained in:
@@ -98,7 +98,7 @@ namespace ams::erpt::srv {
|
||||
}
|
||||
|
||||
s64 JournalForReports::GetMaxReportSize() {
|
||||
s64 max_size;
|
||||
s64 max_size = 0;
|
||||
for (auto it = s_record_list.begin(); it != s_record_list.end(); it++) {
|
||||
max_size = std::max(max_size, it->info.report_size);
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace ams::erpt::srv {
|
||||
auto file_guard = SCOPE_GUARD { if (mode == StreamMode_Write) { fs::CloseFile(this->file_handle); } };
|
||||
|
||||
std::strncpy(this->file_name, path, sizeof(this->file_name));
|
||||
this->file_name[sizeof(this->file_name) - 1] = '\x00';
|
||||
|
||||
this->buffer = reinterpret_cast<u8 *>(Allocate(buffer_size));
|
||||
R_UNLESS(this->buffer != nullptr, erpt::ResultOutOfMemory());
|
||||
|
||||
Reference in New Issue
Block a user