mirror of
https://github.com/sheumann/hush.git
synced 2024-08-21 11:28:57 +00:00
syslogd: small shrink
This commit is contained in:
parent
d2172c04e6
commit
a7259b64e8
@ -647,10 +647,10 @@ int syslogd_main(int argc, char **argv)
|
|||||||
option_mask32 |= OPT_locallog;
|
option_mask32 |= OPT_locallog;
|
||||||
|
|
||||||
/* Store away localhost's name before the fork */
|
/* Store away localhost's name before the fork */
|
||||||
gethostname(G.localHostName, sizeof(G.localHostName));
|
|
||||||
/* "It is unspecified whether the truncated hostname
|
/* "It is unspecified whether the truncated hostname
|
||||||
* will be null-terminated". Idiots! */
|
* will be null-terminated". We give it (size - 1),
|
||||||
G.localHostName[sizeof(G.localHostName) - 1] = '\0';
|
* thus last byte will be NUL no matter what. */
|
||||||
|
gethostname(G.localHostName, sizeof(G.localHostName) - 1);
|
||||||
*strchrnul(G.localHostName, '.') = '\0';
|
*strchrnul(G.localHostName, '.') = '\0';
|
||||||
|
|
||||||
if (!(option_mask32 & OPT_nofork)) {
|
if (!(option_mask32 & OPT_nofork)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user