From 128c9f5bb84f8b03083696cd83e9736d5e95e427 Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 26 Sep 2025 23:51:37 -0400 Subject: [PATCH] Fix error message handling in LoadRomComponent for better string management - Updated the error message assignment in LoadRomComponent to ensure proper string handling by explicitly constructing a std::string from the message data. - This change improves the robustness of error reporting when loading ROM files. --- src/cli/tui.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/tui.cc b/src/cli/tui.cc index db886376..05e29fdd 100644 --- a/src/cli/tui.cc +++ b/src/cli/tui.cc @@ -532,7 +532,7 @@ void LoadRomComponent(ftxui::ScreenInteractive &screen) { // Load the ROM file here. auto rom_status = app_context.rom.LoadFromFile(rom_file); if (!rom_status.ok()) { - app_context.error_message = rom_status.message(); + app_context.error_message = std::string(rom_status.message().data(), rom_status.message().size()); SwitchComponents(screen, LayoutID::kError); return; }