Skip to content

Commit 163f84c

Browse files
committed
Replace local variable with direct access to class member string.
1 parent 5db1b97 commit 163f84c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/utility/ota/OTA-nano-rp2040.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,19 @@ int rp2040_connect_onOTARequest(char const * ota_url)
106106
return static_cast<int>(OTAError::RP2040_UrlParseError);
107107
}
108108

109-
const char* host = url.host_.c_str();
110-
111109
mbed_watchdog_reset();
112110

113-
int ret = client->connect(host, port);
111+
int ret = client->connect(url.host_.c_str(), port);
114112
if (!ret)
115113
{
116-
DEBUG_ERROR("%s: Connection failure with OTA storage server %s", __FUNCTION__, host);
114+
DEBUG_ERROR("%s: Connection failure with OTA storage server %s", __FUNCTION__, url.host_.c_str());
117115
return static_cast<int>(OTAError::RP2040_ServerConnectError);
118116
}
119117

120118
mbed_watchdog_reset();
121119

122120
client->println(String("GET ") + url.path_.c_str() + " HTTP/1.1");
123-
client->println(String("Host: ") + host);
121+
client->println(String("Host: ") + url.host_.c_str());
124122
client->println("Connection: close");
125123
client->println();
126124

0 commit comments

Comments
 (0)