diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-07-09 06:32:28 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-07-09 06:32:28 +0000 |
commit | f65bed3e4e47f791b47ed885ed13c1f7ca957c18 (patch) | |
tree | 1468dc284f3e4afb4a6894fa542690abc1601e02 /usr.sbin/traceroute/traceroute.c | |
parent | 86cf04ef390042d4090a9df13925285d14d7def2 (diff) |
MAXHOSTNAMELEN, and no need to terminate
Diffstat (limited to 'usr.sbin/traceroute/traceroute.c')
-rw-r--r-- | usr.sbin/traceroute/traceroute.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c index 260b493117e..146f4863a5c 100644 --- a/usr.sbin/traceroute/traceroute.c +++ b/usr.sbin/traceroute/traceroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: traceroute.c,v 1.25 1997/06/28 20:19:02 denny Exp $ */ +/* $OpenBSD: traceroute.c,v 1.26 1998/07/09 06:32:27 deraadt Exp $ */ /* $NetBSD: traceroute.c,v 1.10 1995/05/21 15:50:45 mycroft Exp $ */ /*- @@ -891,12 +891,11 @@ inetname(in) if (first && !nflag) { first = 0; - if (gethostname(domain, MAXHOSTNAMELEN) == 0 && + if (gethostname(domain, sizeof domain) == 0 && (cp = strchr(domain, '.')) != NULL) { (void)strncpy(domain, cp + 1, sizeof(domain) - 1); domain[sizeof(domain) - 1] = '\0'; - } else - domain[0] = '\0'; + } } if (!nflag && in.s_addr != INADDR_ANY) { hp = gethostbyaddr((char *)&in, sizeof(in), AF_INET); |