summaryrefslogtreecommitdiff
path: root/src/tc-socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tc-socket.c')
-rw-r--r--src/tc-socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tc-socket.c b/src/tc-socket.c
index 3cdeb90..2c140a1 100644
--- a/src/tc-socket.c
+++ b/src/tc-socket.c
@@ -17,6 +17,7 @@
static int t_parse(void)
{
char host[32] = "bogus";
+ uint16_t port = 4321;
if (HX_addrport_split("[::1]", host, sizeof(host), nullptr) != 1 ||
strcmp(host, "::1") != 0)
return 1;
@@ -26,6 +27,9 @@ static int t_parse(void)
if (HX_addrport_split("", host, sizeof(host), nullptr) != 1 ||
strcmp(host, "") != 0)
return 1;
+ if (HX_addrport_split("[]:", host, sizeof(host), &port) != 1 ||
+ strcmp(host, "") != 0 || port != 0)
+ return 1;
return 0;
}