From 6eb9a47476c999e896cf36c79a8d13b59a4a5c91 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Fri, 25 Apr 2014 19:14:20 +0800 Subject: [PATCH] Allow specifying empty port numbers --- src/transport/common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/transport/common.c b/src/transport/common.c index a267a28..065fe25 100644 --- a/src/transport/common.c +++ b/src/transport/common.c @@ -44,7 +44,8 @@ static struct addrinfo * _init_address(char const * name, int domain, int flags) return NULL; } /* obtain the port number */ - if(hostname == NULL || (servname = strrchr(hostname, sep)) == NULL) + if(hostname == NULL || (servname = strrchr(hostname, sep)) == NULL + || servname[1] == '\0') { l = 0; servname = NULL;