diff options
Diffstat (limited to 'kike.c')
-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", |