From 06dd5b8936f8aaaf02ec9a449e86073f50ffa607 Mon Sep 17 00:00:00 2001 From: Peter Pentchev Date: Fri, 17 Dec 2010 13:31:41 +0200 Subject: [PATCH] Make add_host() really return an error code. Now that add_host() *may* return an error, it is kind of confusing (and actually leads to errors) that it also returns the number of hosts added to the value/result "hosts" array. Since the caller really checks add_host()'s return value now, a successful lookup that returns one host added will be treated as an error :) --- dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns.c b/dns.c index ef78e64..ce80745 100644 --- a/dns.c +++ b/dns.c @@ -105,7 +105,7 @@ add_host(int pref, const char *host, int port, struct mx_hostentry **he, size_t } freeaddrinfo(res0); - return (*ps - onhosts); + return (0); out: if (res0 != NULL) -- 2.47.3