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:
Jon Foster
2024-04-01 19:23:49 +01:00
committed by Damien George
parent 289b2dd879
commit 92484d8822
28 changed files with 40 additions and 40 deletions

View File

@@ -344,7 +344,7 @@ static mp_obj_t ppp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs
char ifname[NETIF_NAMESIZE + 1] = {0};
netif_index_to_name(netif_get_index(pppif), ifname);
if (ifname[0] != 0) {
val = mp_obj_new_str((char *)ifname, strlen(ifname));
val = mp_obj_new_str_from_cstr((char *)ifname);
}
}
break;