Skip to content

Commit

Permalink
w60x: Convert NUL-terminated C strings to MicroPython strings follow up.
Browse files Browse the repository at this point in the history
Following PR 14227 of MicroPython master.

Signed-off-by: robert-hh <robert@hammelrath.com>
  • Loading branch information
robert-hh committed Sep 4, 2024
1 parent 46f6e1c commit 6e40269
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ports/w60x/modules/modsocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ static mp_obj_t w600_socket_getaddrinfo(size_t n_args, const mp_obj_t *args) {
mp_obj_new_int(resi->ai_family),
mp_obj_new_int(resi->ai_socktype),
mp_obj_new_int(resi->ai_protocol),
mp_obj_new_str(resi->ai_canonname, strlen(resi->ai_canonname)),
mp_obj_new_str_from_cstr(resi->ai_canonname),
mp_const_none
};

Expand All @@ -702,7 +702,7 @@ static mp_obj_t w600_socket_getaddrinfo(size_t n_args, const mp_obj_t *args) {
char buf[16];
ip4addr_ntoa_r(&ip4_addr, buf, sizeof(buf));
mp_obj_t inaddr_objs[2] = {
mp_obj_new_str(buf, strlen(buf)),
mp_obj_new_str_from_cstr(buf),
mp_obj_new_int(ntohs(addr->sin_port))
};
addrinfo_objs[4] = mp_obj_new_tuple(2, inaddr_objs);
Expand Down

0 comments on commit 6e40269

Please sign in to comment.