diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp index 25c30abf1e4..627b4b0a991 100644 --- a/src/emu/emuopts.cpp +++ b/src/emu/emuopts.cpp @@ -278,15 +278,15 @@ void emu_options::update_slot_options() for (device_slot_interface *slot = iter.first(); slot != nullptr; slot = iter.next()) { // retrieve info about the device instance - const char *name = slot->device().tag().c_str() + 1; - if (exists(name) && slot->first_option() != nullptr) + std::string name(slot->device().tag().c_str()+1); + if (exists(name.c_str()) && slot->first_option() != nullptr) { std::string defvalue = slot->get_default_card_software(); if (defvalue.length() > 0) { - set_default_value(name, defvalue.c_str()); + set_default_value(name.c_str(), defvalue.c_str()); const device_slot_option *option = slot->option(defvalue.c_str()); - set_flag(name, ~OPTION_FLAG_INTERNAL, (option != nullptr && !option->selectable()) ? OPTION_FLAG_INTERNAL : 0); + set_flag(name.c_str(), ~OPTION_FLAG_INTERNAL, (option != nullptr && !option->selectable()) ? OPTION_FLAG_INTERNAL : 0); } } }