From 10452f7c93c3a492c1f8fdc4a49b65ddc40b27a2 Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Tue, 6 Dec 2016 16:51:45 +0530 Subject: core: introduce parse_ip_port (#4825) 1. Listed in TODO. 2. Tree wide replace safe_atou16 with parse_ip_port incase it's used for ports. --- src/resolve/resolve-tool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/resolve') diff --git a/src/resolve/resolve-tool.c b/src/resolve/resolve-tool.c index 9d4d04220c..07d9582ccb 100644 --- a/src/resolve/resolve-tool.c +++ b/src/resolve/resolve-tool.c @@ -881,8 +881,8 @@ static int resolve_tlsa(sd_bus *bus, const char *address) { port = strrchr(address, ':'); if (port) { - r = safe_atou16(port + 1, &port_num); - if (r < 0 || port_num == 0) + r = parse_ip_port(port + 1, &port_num); + if (r < 0) return log_error_errno(r, "Invalid port \"%s\".", port + 1); address = strndupa(address, port - address); -- cgit v1.2.3-54-g00ecf