mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 04:00:28 +01:00
all: Use new mp_obj_new_str_from_cstr() function.
Use new function mp_obj_new_str_from_cstr() where appropriate. It simplifies the code, and makes it smaller too. Signed-off-by: Jon Foster <jon@jon-foster.co.uk>
This commit is contained in:
committed by
Damien George
parent
289b2dd879
commit
92484d8822
@@ -626,7 +626,7 @@ static mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
|
||||
case MP_QSTR_ssid:
|
||||
case MP_QSTR_essid:
|
||||
if (self->if_id == STATION_IF) {
|
||||
val = mp_obj_new_str((char *)cfg.sta.ssid, strlen((char *)cfg.sta.ssid));
|
||||
val = mp_obj_new_str_from_cstr((char *)cfg.sta.ssid);
|
||||
} else {
|
||||
val = mp_obj_new_str((char *)cfg.ap.ssid, cfg.ap.ssid_len);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user