Fix crash with a dotless hostname.
This commit is contained in:
parent
f247f2d5c2
commit
d03569547d
@ -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