diff options
author | pfg <pfg@FreeBSD.org> | 2016-05-14 04:29:13 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-05-14 04:29:13 +0000 |
commit | 20bb6d5f63e3b133721ac858f3459826099ea994 (patch) | |
tree | 6a56ad5bae73d7d93ddf3f7ffa700c28112bd673 /usr.sbin/timed | |
parent | 9a3d27c1e5ae4f1f4584801d043c7ea2cefc1191 (diff) | |
download | FreeBSD-src-20bb6d5f63e3b133721ac858f3459826099ea994.zip FreeBSD-src-20bb6d5f63e3b133721ac858f3459826099ea994.tar.gz |
Undo the bogus gethostname() change from r299709.
The "- 1" is there specifically to enable checking for NUL termination.
I should also admit the rest change was mostly cosmetic and the
overruns can't occur in practice: still I leave them to pacify
static analyzers.
Pointed out by: bde
Diffstat (limited to 'usr.sbin/timed')
-rw-r--r-- | usr.sbin/timed/timed/timed.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/timed/timed/timed.c b/usr.sbin/timed/timed/timed.c index 21c98b0..a8efd6d 100644 --- a/usr.sbin/timed/timed/timed.c +++ b/usr.sbin/timed/timed/timed.c @@ -196,7 +196,7 @@ main(int argc, char *argv[]) if (goodgroup != NULL || goodhosts != NULL) Mflag = 1; - if (gethostname(hostname, sizeof(hostname)) < 0) + if (gethostname(hostname, sizeof(hostname) - 1) < 0) err(1, "gethostname"); self.l_bak = &self; self.l_fwd = &self; |