diff --git a/src/frontend/mame/ui/state.cpp b/src/frontend/mame/ui/state.cpp index 635b980c6ba..633db99405e 100644 --- a/src/frontend/mame/ui/state.cpp +++ b/src/frontend/mame/ui/state.cpp @@ -374,12 +374,10 @@ void menu_load_save_state_base::handle_keys(uint32_t flags, int &iptkey) if (exclusive_input_pressed(iptkey, IPT_UI_SELECT, 0)) { // try to remove the file - std::string const filename(util::string_format( - "%2$s%1$s%3$s%1$s%4$s.sta", - PATH_SEPARATOR, + std::string const filename(util::path_concat( machine().options().state_directory(), machine().get_statename(machine().options().state_name()), - m_confirm_delete->file_name())); + m_confirm_delete->file_name() + ".sta")); std::error_condition const err(osd_file::remove(filename)); if (err) { @@ -485,11 +483,9 @@ const menu_load_save_state_base::file_entry &menu_load_save_state_base::file_ent std::string menu_load_save_state_base::state_directory() const { - const char *stateopt = machine().options().state_name(); - return util::string_format("%s%s%s", + return util::path_concat( machine().options().state_directory(), - PATH_SEPARATOR, - machine().get_statename(stateopt)); + machine().get_statename(machine().options().state_name())); }