From: simon Date: Fri, 7 Dec 2012 19:04:20 +0000 (+0000) Subject: Stop passing "http" to getaddrinfo in the case when we only need an IP X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/agedu/commitdiff_plain/712ecaa057b431ab141bb9864096d6fa49d6c581 Stop passing "http" to getaddrinfo in the case when we only need an IP address. It's legal to pass NULL as a service string, so I don't know why I didn't do that in the first place. git-svn-id: svn://svn.tartarus.org/sgt/agedu@9722 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/httpd.c b/httpd.c index daaea67..608287e 100644 --- a/httpd.c +++ b/httpd.c @@ -570,7 +570,7 @@ static int make_listening_sockets(struct listenfds *fds, const char *address, hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; hints.ai_flags = AI_PASSIVE; - ret = getaddrinfo(address, portstr ? portstr : "http", &hints, &addrs); + ret = getaddrinfo(address, portstr, &hints, &addrs); if (ret) { fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(ret)); return -1;