src: fix -Wreturn-stack-address error · nodejs/node@440d4f4

Original file line numberDiff line numberDiff line change

@@ -23,7 +23,7 @@ std::optional<std::string_view> ConfigReader::GetDataFromArgs(

2323

} else if (it->starts_with(flag_path)) {

2424

// Case: "--experimental-config-file=foo"

2525

if (it->size() > flag_path.size() && (*it)[flag_path.size()] == '=') {

26-

return it->substr(flag_path.size() + 1);

26+

return std::string_view(*it).substr(flag_path.size() + 1);

2727

}

2828

} else if (*it == default_file || it->starts_with(default_file)) {

2929

has_default_config_file = true;