diff src/lib/net.c @ 16666:58be84a381e5

net_ip2addr() changed to return "" instead of NULL on failure. Pretty much everything in the code assumed that it would never fail, which it normally doesn't except if the ip_addr was created for UNIX sockets.
author Timo Sirainen <tss@iki.fi>
date Tue, 06 Aug 2013 14:53:23 +0300
parents dc60e46f0cb5
children 07cc79e0041d
line wrap: on
line diff
--- a/src/lib/net.c	Tue Aug 06 14:46:36 2013 +0300
+++ b/src/lib/net.c	Tue Aug 06 14:53:23 2013 +0300
@@ -870,14 +870,14 @@
 
 	addr[MAX_IP_LEN] = '\0';
 	if (inet_ntop(ip->family, &ip->u.ip6, addr, MAX_IP_LEN) == NULL)
-		return NULL;
+		return "";
 
 	return t_strdup(addr);
 #else
 	unsigned long ip4;
 
 	if (ip->family != AF_INET)
-		return NULL;
+		return "";
 
 	ip4 = ntohl(ip->u.ip4.s_addr);
 	return t_strdup_printf("%lu.%lu.%lu.%lu",