Commit 43f58386 authored by Paul Sokolovsky's avatar Paul Sokolovsky

zephyr/modusocket: getaddrinfo: Fix mp_obj_len() usage.

Return value is mp_obj_t, so needs to be accessed using
MP_OBJ_SMALL_INT_VALUE().
parent f245f5d7
......@@ -587,7 +587,8 @@ STATIC mp_obj_t mod_getaddrinfo(size_t n_args, const mp_obj_t *args) {
// Raise error only if there's nothing to return, otherwise
// it may be IPv4 vs IPv6 differences.
if (state.status != 0 && mp_obj_len(state.result) == 0) {
mp_int_t len = MP_OBJ_SMALL_INT_VALUE(mp_obj_len(state.result));
if (state.status != 0 && len == 0) {
mp_raise_OSError(state.status);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment