From eef318301421b0ade7f184543f7165df583744c2 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Fri, 13 Oct 2017 17:14:47 +0200 Subject: [PATCH] Merge pull request #769 from horgh/horgh/error-check-server-connect Set host to an empty string on error --- src/core/network.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/network.c b/src/core/network.c index 3e1b7c70..3ec8ec7a 100644 --- a/src/core/network.c +++ b/src/core/network.c @@ -462,6 +462,7 @@ int net_gethostbyaddr(IPADDR *ip, char **name) int net_ip2host(IPADDR *ip, char *host) { + host[0] = '\0'; return inet_ntop(ip->family, &ip->ip, host, MAX_IP_LEN) ? 0 : -1; }