if (addr->family == AF_INET6) { FIXME;  } else #endif if (addr->family == AF_INET) {
if (getnameinfo(addr->ai->ai_addr, addr->ai->ai_addrlen, buf, buflen, NULL, 0, NI_NUMERICHOST) != 0) { buf[0] = '\0'; strncat(buf, "<unknown>", buflen - 1); } #else
void sk_getaddr(SockAddr addr, char *buf, int buflen){#ifdef IPV6    if (addr->family == AF_INET6) {	FIXME; /* I don't know how to get a text form of an IPv6 address. */    } else#endif    if (addr->family == AF_INET) {	struct in_addr a;	a.s_addr = htonl(addr->address);	strncpy(buf, inet_ntoa(a), buflen);	buf[buflen-1] = '\0';    } else {	assert(addr->family == AF_UNSPEC);	strncpy(buf, addr->hostname, buflen);	buf[buflen-1] = '\0';    }}