src: fix -Wreturn-stack-address error

PR-URL: https://github.com/nodejs/node/pull/58439
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Shelley Vohr authored and Michaël Zasso committed 2025-05-31 13:31:46 +02:00
1 parent 79b852a692
commit 440d4f42bd
1 file changed
+1 -1
+1 -1
View File
@@ -23,7 +23,7 @@ std::optional<std::string_view> ConfigReader::GetDataFromArgs(
} else if (it->starts_with(flag_path)) {
// Case: "--experimental-config-file=foo"
if (it->size() > flag_path.size() && (*it)[flag_path.size()] == '=') {
return it->substr(flag_path.size() + 1);
return std::string_view(*it).substr(flag_path.size() + 1);
}
} else if (*it == default_file || it->starts_with(default_file)) {
has_default_config_file = true;