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.
pull/11008/head
Oliver Joos 2023-03-11 15:50:16 +01:00 zatwierdzone przez Damien George
rodzic 3d46fe67bf
commit 11b5ee0d7c
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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);
}