aboutsummaryrefslogtreecommitdiff
path: root/contrib/amd/amd/amd.c
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>1998-11-14 03:11:37 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>1998-11-14 03:11:37 +0000
commit37d7e39316c27335d27d2cbf88c7bd4444b50e88 (patch)
treea4eb3d7f17ca252572bc28a3ec00f1e8ebd00f5d /contrib/amd/amd/amd.c
parentab38884b94958f20500a215ab38fe4a675d4c4f6 (diff)
downloadsrc-37d7e39316c27335d27d2cbf88c7bd4444b50e88.tar.gz
src-37d7e39316c27335d27d2cbf88c7bd4444b50e88.zip
Virgin import of AMD (am-utils) v6.0b1
Notes
Notes: svn path=/vendor/amd/dist/; revision=41142
Diffstat (limited to 'contrib/amd/amd/amd.c')
-rw-r--r--contrib/amd/amd/amd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/amd/amd/amd.c b/contrib/amd/amd/amd.c
index 7ef2ce7ed69d..bc750e51d335 100644
--- a/contrib/amd/amd/amd.c
+++ b/contrib/amd/amd/amd.c
@@ -57,8 +57,8 @@ struct amu_global_options gopt; /* where global options are stored */
char pid_fsname[16 + MAXHOSTNAMELEN]; /* "kiska.southseas.nz:(pid%d)" */
char *progname; /* "amd" */
char *hostdomain = "unknown.domain";
-char hostname[MAXHOSTNAMELEN] = "localhost"; /* Hostname */
-char hostd[2 * MAXHOSTNAMELEN]; /* Host+domain */
+char hostname[MAXHOSTNAMELEN + 1] = "localhost"; /* Hostname */
+char hostd[2 * MAXHOSTNAMELEN + 1]; /* Host+domain */
char *endian = ARCH_ENDIAN; /* Big or Little endian */
char *cpu = HOST_CPU; /* CPU type */
char *PrimNetName; /* name of primary network */
@@ -349,6 +349,7 @@ main(int argc, char *argv[])
plog(XLOG_FATAL, "gethostname: %m");
going_down(1);
}
+ hostname[sizeof(hostname) - 1] = '\0';
/*
* Check it makes sense