diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2014-08-18 23:02:54 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2014-08-18 23:02:54 +0200 |
commit | 9fab2fd2bdf8c17b8cda9479cabd48a2618adeb7 (patch) | |
tree | 5716a67b86554ad9d3245c7032726ec7f4f9d4e8 | |
parent | 371cd5ea215992152a8226d42f2ed41471535d7f (diff) | |
download | xK-9fab2fd2bdf8c17b8cda9479cabd48a2618adeb7.tar.gz xK-9fab2fd2bdf8c17b8cda9479cabd48a2618adeb7.tar.xz xK-9fab2fd2bdf8c17b8cda9479cabd48a2618adeb7.zip |
kike: don't use HOST_NAME_MAX
FreeBSD doesn't have it.
-rw-r--r-- | kike.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -2890,7 +2890,11 @@ irc_initialize_server_name (struct server_context *ctx, struct error **e) } else { - char hostname[HOST_NAME_MAX]; + long host_name_max = sysconf (_SC_HOST_NAME_MAX); + if (host_name_max <= 0) + host_name_max = _POSIX_HOST_NAME_MAX; + + char hostname[host_name_max + 1]; if (gethostname (hostname, sizeof hostname)) { error_set (e, "%s: %s", |