aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/logger
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2017-12-06 17:50:10 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2017-12-06 17:50:10 +0000
commit2ff3551a477fcad307baf808991472954ca0edc6 (patch)
tree7e44323e36e664eaab68ac93c7d790e6cc47cf30 /usr.bin/logger
parent99ae1d3b250cf034bbaf5bd54650aaf22e998553 (diff)
downloadsrc-2ff3551a477fcad307baf808991472954ca0edc6.tar.gz
src-2ff3551a477fcad307baf808991472954ca0edc6.zip
Fix crash with a dotless hostname.
Notes
Notes: svn path=/head/; revision=326625
Diffstat (limited to 'usr.bin/logger')
-rw-r--r--usr.bin/logger/logger.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/logger/logger.c b/usr.bin/logger/logger.c
index f88ad1ee8cf3..71cc5fbb7aa0 100644
--- a/usr.bin/logger/logger.c
+++ b/usr.bin/logger/logger.c
@@ -183,7 +183,7 @@ main(int argc, char *argv[])
if (hostname == NULL) {
hostname = hbuf;
(void )gethostname(hbuf, MAXHOSTNAMELEN);
- *strchr(hostname, '.') = '\0';
+ *strchrnul(hostname, '.') = '\0';
}
/* log input line if appropriate */