(Network) Fix getnameinfo_retro's port value for HAVE_SOCKET_LEGACY platforms (#14303)

This commit is contained in:
Cthulhu-throwaway 2022-08-08 10:28:42 -03:00 committed by GitHub
parent 5ffe62a52b
commit d3f3c58e61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -376,7 +376,7 @@ int getnameinfo_retro(const struct sockaddr *addr, socklen_t addrlen,
NI_NUMERICSERV (always enforced)
*/
if (serv && servlen)
snprintf(serv, servlen, "%hu", (unsigned short)addr4->sin_port);
snprintf(serv, servlen, "%hu", (unsigned short)ntohs(addr4->sin_port));
return 0;
#else