summary refs log tree commit diff
diff options
context:
space:
mode:
authorwrmr2024-11-06 00:06:11 -0500
committerwrmr2024-11-06 00:06:11 -0500
commitc38691b0001b477e2915ea90971e2ebc76e854ad (patch)
tree4a1b40dba9c2f16355f123d1e43a9701d05cf3ea
parent5fe796490718f84d20ff9c836ce75d5318d44c69 (diff)
fix off-by-one error in port parsing
-rw-r--r--net.c2
1 files changed, 1 insertions, 1 deletions
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 {