From c38691b0001b477e2915ea90971e2ebc76e854ad Mon Sep 17 00:00:00 2001 From: wrmr Date: Wed, 6 Nov 2024 00:06:11 -0500 Subject: fix off-by-one error in port parsing --- net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net.c b/net.c index 6fbfa97..b3f0655 100644 --- a/net.c +++ b/net.c @@ -53,7 +53,7 @@ int net_addr(const char *url, struct addr *adr, enum protocol prot_default) { char *colon = strchr(adr->host, ':'); if (colon) { errno = 0; - int port = strtoul(colon, NULL, 10); + int port = strtoul(colon + 1, NULL, 10); if (errno) { return -1; } else { -- cgit 1.4.1-2-gfad0