Second Parameter of getaddrinfo in rest_client.c suspicious

Hello Nordic-Team,

 I wanted to use the REST client in version v2.5.0 of the nrf Connect SDK. I was surprised to see getaddrinfo being called with the port as string as second parameter (nrf/subsys/net/lib/rest_client/src/rest_client.c, line 174):

snprintf(portstr, 6, "%d", port_num);

LOG_DBG("Doing getaddrinfo() with connect addr %s port %s", hostname, portstr);

ret = getaddrinfo(hostname, portstr, &hints, &addr_info);

I have a separate file in which I use getaddrinfo successfully and it has the parameters

int getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res);

Could you please give me an idea why the api of such a common function has been changed? Or am I getting something very wrong?

Related