mirror of
https://github.com/esphome/esphome.git
synced 2026-02-08 08:41:59 +00:00
address copilot review comments
This commit is contained in:
@@ -55,8 +55,7 @@ struct IPAddress {
|
||||
std::string str() const { return str_lower_case(inet_ntoa(ip_addr_)); }
|
||||
/// Write IP address to buffer. Buffer must be at least IP_ADDRESS_BUFFER_SIZE bytes.
|
||||
char *str_to(char *buf) const {
|
||||
inet_ntop(AF_INET, &ip_addr_, buf, IP_ADDRESS_BUFFER_SIZE);
|
||||
return buf;
|
||||
return const_cast<char *>(inet_ntop(AF_INET, &ip_addr_, buf, IP_ADDRESS_BUFFER_SIZE));
|
||||
}
|
||||
#else
|
||||
IPAddress() { ip_addr_set_zero(&ip_addr_); }
|
||||
|
||||
@@ -63,7 +63,7 @@ void ScanResultsWiFiInfo::setup() { wifi::global_wifi_component->add_scan_result
|
||||
|
||||
void ScanResultsWiFiInfo::dump_config() { LOG_TEXT_SENSOR("", "Scan Results", this); }
|
||||
|
||||
// Format: "SSID: -XXdB\n" - caller must ensure 9 bytes available after ssid
|
||||
// Format: "SSID: -XXdB\n" - caller must ensure ssid_len + 9 bytes available in buffer
|
||||
static char *format_scan_entry(char *buf, const char *ssid, size_t ssid_len, int8_t rssi) {
|
||||
memcpy(buf, ssid, ssid_len);
|
||||
buf += ssid_len;
|
||||
|
||||
Reference in New Issue
Block a user