diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2017-12-06 17:50:10 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2017-12-06 17:50:10 +0000 |
commit | 2ff3551a477fcad307baf808991472954ca0edc6 (patch) | |
tree | 7e44323e36e664eaab68ac93c7d790e6cc47cf30 /usr.bin/logger | |
parent | 99ae1d3b250cf034bbaf5bd54650aaf22e998553 (diff) | |
download | src-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.c | 2 |
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 */ |