Fix crash with a dotless hostname.
This commit is contained in:
parent
99ae1d3b25
commit
2ff3551a47
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user