extmod/network_cyw43: Fix setting hostname using config() method.

This bug is probably a typo. args[0] is the cyw43 object itself.
While the value of a kwargs is in e->value.
This commit is contained in:
Oliver Joos 2023-03-11 15:50:16 +01:00 committed by Damien George
parent 3d46fe67bf
commit 11b5ee0d7c
1 changed files with 1 additions and 1 deletions

View File

@ -474,7 +474,7 @@ STATIC mp_obj_t network_cyw43_config(size_t n_args, const mp_obj_t *args, mp_map
case MP_QSTR_hostname: {
// TODO: Deprecated. Use network.hostname(name) instead.
size_t len;
const char *str = mp_obj_str_get_data(args[0], &len);
const char *str = mp_obj_str_get_data(e->value, &len);
if (len >= MICROPY_PY_NETWORK_HOSTNAME_MAX_LEN) {
mp_raise_ValueError(NULL);
}