summaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
authorDenis Vlasenko2008-02-23 12:08:36 +0000
committerDenis Vlasenko2008-02-23 12:08:36 +0000
commita7259b64e84cd669ae8be253d8621c7db48de4d2 (patch)
treed518b4b8831de161b1ed4c0a279746838cf5f2b9 /sysklogd
parentd2172c04e6c53aedc9194d0a86a4686e5af31364 (diff)
downloadbusybox-a7259b64e84cd669ae8be253d8621c7db48de4d2.zip
busybox-a7259b64e84cd669ae8be253d8621c7db48de4d2.tar.gz
syslogd: small shrink
Diffstat (limited to 'sysklogd')
-rw-r--r--sysklogd/syslogd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 0d98351..c713507 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -647,10 +647,10 @@ int syslogd_main(int argc, char **argv)
option_mask32 |= OPT_locallog;
/* Store away localhost's name before the fork */
- gethostname(G.localHostName, sizeof(G.localHostName));
/* "It is unspecified whether the truncated hostname
- * will be null-terminated". Idiots! */
- G.localHostName[sizeof(G.localHostName) - 1] = '\0';
+ * will be null-terminated". We give it (size - 1),
+ * thus last byte will be NUL no matter what. */
+ gethostname(G.localHostName, sizeof(G.localHostName) - 1);
*strchrnul(G.localHostName, '.') = '\0';
if (!(option_mask32 & OPT_nofork)) {