From 440d4f42bdfbb5e016bf1d173fc07645e78bdae7 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 28 May 2025 15:56:20 +0200 Subject: [PATCH] src: fix -Wreturn-stack-address error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/58439 Reviewed-By: Juan José Arboleda Reviewed-By: Yagiz Nizipli Reviewed-By: Jake Yuesong Li Reviewed-By: Anna Henningsen --- src/node_config_file.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_config_file.cc b/src/node_config_file.cc index e697002ae1a..3f590b53eba 100644 --- a/src/node_config_file.cc +++ b/src/node_config_file.cc @@ -23,7 +23,7 @@ std::optional 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;