by Volker. We used to return 0.0.0.0 for the text
address of an uninitialized socket - ensure we
still do so. Once uninitialized address is as
good as any other.
Jeremy.
socklen_t length = sizeof(sa);
static char addr_buf[INET6_ADDRSTRLEN];
- addr_buf[0] = '\0';
+ /* Ok, returning a hard coded IPv4 address
+ * is bogus, but it's just as bogus as a
+ * zero IPv6 address. No good choice here.
+ */
+
+ safe_strcpy(addr_buf, "0.0.0.0", sizeof(addr_buf)-1);
if (fd == -1) {
return addr_buf;