Skip to content

Commit 0b58d02

Browse files
committed
esp32,esp8266: Use new mp_obj_new_str_from_cstr() function.
These were missed in the previous commit. Signed-off-by: Damien George <[email protected]>
1 parent 92484d8 commit 0b58d02

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ports/esp32/network_common.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static mp_obj_t esp_network_ipconfig(size_t n_args, const mp_obj_t *args, mp_map
166166
case MP_QSTR_dns: {
167167
char addr_str[IPADDR_STRLEN_MAX];
168168
ipaddr_ntoa_r(dns_getserver(0), addr_str, sizeof(addr_str));
169-
return mp_obj_new_str(addr_str, strlen(addr_str));
169+
return mp_obj_new_str_from_cstr(addr_str);
170170
}
171171
default: {
172172
mp_raise_ValueError(MP_ERROR_TEXT("unexpected key"));

ports/esp8266/network_wlan.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static mp_obj_t esp_network_ipconfig(size_t n_args, const mp_obj_t *args, mp_map
345345
char addr_str[IPADDR_STRLEN_MAX];
346346
ip_addr_t dns_addr = dns_getserver(0);
347347
ipaddr_ntoa_r(&dns_addr, addr_str, sizeof(addr_str));
348-
return mp_obj_new_str(addr_str, strlen(addr_str));
348+
return mp_obj_new_str_from_cstr(addr_str);
349349
}
350350
default: {
351351
mp_raise_ValueError(MP_ERROR_TEXT("unexpected key"));

0 commit comments

Comments
 (0)