+2001-09-07 Ken Raeburn <raeburn@mit.edu>
+
+ * commands.c (tn): Don't crash printing null hostname in case
+ where supplied destination is a numeric address that doesn't map
+ to a hostname.
+
2001-09-01 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (SRCS): Use $(srcdir).
error = getaddrinfo (hostp, portp, &hints, &addrs);
if (error == 0) {
if (getnameinfo (addrs->ai_addr, addrs->ai_addrlen,
- _hostname, sizeof(_hostname), 0, 0, NI_NAMEREQD) == 0)
- hostname = _hostname;
+ _hostname, sizeof(_hostname), 0, 0, NI_NAMEREQD) != 0)
+ strncpy(_hostname, hostp, sizeof (_hostname));
+ hostname = _hostname;
} else {
not_numeric:
hints.ai_flags = AI_CANONNAME;