diff options
author | obrien <obrien@FreeBSD.org> | 1998-11-14 03:11:37 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1998-11-14 03:11:37 +0000 |
commit | c6e3533e1e31cbf25e04688d244a8fc2af2e1972 (patch) | |
tree | a4eb3d7f17ca252572bc28a3ec00f1e8ebd00f5d /contrib/amd/wire-test | |
parent | 663d5a0f32ed8dfc091ffb6153161591ac6ba563 (diff) | |
download | FreeBSD-src-c6e3533e1e31cbf25e04688d244a8fc2af2e1972.zip FreeBSD-src-c6e3533e1e31cbf25e04688d244a8fc2af2e1972.tar.gz |
Virgin import of AMD (am-utils) v6.0b1
Diffstat (limited to 'contrib/amd/wire-test')
-rw-r--r-- | contrib/amd/wire-test/wire-test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/amd/wire-test/wire-test.c b/contrib/amd/wire-test/wire-test.c index c53094b..11e3e99 100644 --- a/contrib/amd/wire-test/wire-test.c +++ b/contrib/amd/wire-test/wire-test.c @@ -50,7 +50,7 @@ #define STRMAX 100 /* dummy variables */ -char *progname, hostname[MAXHOSTNAMELEN]; +char *progname, hostname[MAXHOSTNAMELEN + 1]; int orig_umask, foreground, debug_flags; pid_t mypid; serv_state amd_state; @@ -69,10 +69,11 @@ main(int argc, char **argv) mypid = getpid(); orig_umask = umask(0); - if (gethostname(hostname, MAXHOSTNAMELEN) < 0) { + if (gethostname(hostname, sizeof(hostname)) < 0) { perror(argv[0]); exit(1); } + hostname[sizeof(hostname) - 1] = '\0'; /* get list of networks */ getwire(&networkName1, &networkNumber1); |