diff --git a/usr.bin/logger/logger.c b/usr.bin/logger/logger.c index f88ad1ee8cf..71cc5fbb7aa 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 */