mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
UICommon: Fix unsafe usage of optparse::Values::all
The const-qualified all() member method triggers undefined behaviour if the option passed to it is not set.
This commit is contained in:
parent
60afb1d1b4
commit
653977cec7
@ -107,9 +107,9 @@ std::unique_ptr<optparse::OptionParser> CreateParser(ParserOptions options)
|
|||||||
|
|
||||||
static void AddConfigLayer(const optparse::Values& options)
|
static void AddConfigLayer(const optparse::Values& options)
|
||||||
{
|
{
|
||||||
const std::list<std::string>& config_args = options.all("config");
|
if (options.is_set_by_user("config"))
|
||||||
if (!config_args.empty())
|
|
||||||
{
|
{
|
||||||
|
const std::list<std::string>& config_args = options.all("config");
|
||||||
Config::AddLayer(std::make_unique<CommandLineConfigLayerLoader>(
|
Config::AddLayer(std::make_unique<CommandLineConfigLayerLoader>(
|
||||||
config_args, static_cast<const char*>(options.get("video_backend")),
|
config_args, static_cast<const char*>(options.get("video_backend")),
|
||||||
static_cast<const char*>(options.get("audio_emulation"))));
|
static_cast<const char*>(options.get("audio_emulation"))));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user