diff --git a/appl/test/common.c b/appl/test/common.c index 8ad0b89df..dc9e0fb6b 100644 --- a/appl/test/common.c +++ b/appl/test/common.c @@ -131,7 +131,7 @@ client_doit (const char *hostname, int port, const char *service, hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; - snprintf (portstr, sizeof(portstr), "%u", port); + snprintf (portstr, sizeof(portstr), "%u", ntohs(port)); error = getaddrinfo (hostname, portstr, &hints, &ai); if (error) {