aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2021-01-19 14:41:02 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-21 11:00:02 +0000
commitc531c6bc0e0e91722ec99da376d556af46b22bbc (patch)
treed0af50a08d006abadc6f57c29964a50fee1f5b33
parentterminal: add/exclude missing headers (diff)
uri: switch to conservative maximum hostname length
Current maximum is provided by sysconf(_SC_HOST_NAME_MAX) instead. uri.c:269:20: error: use of undeclared identifier 'HOST_NAME_MAX' char this_host[HOST_NAME_MAX]; ^
-rw-r--r--uri.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/uri.c b/uri.c
index 21eba6fb..51cd8093 100644
--- a/uri.c
+++ b/uri.c
@@ -266,7 +266,7 @@ err:
bool
hostname_is_localhost(const char *hostname)
{
- char this_host[HOST_NAME_MAX];
+ char this_host[_POSIX_HOST_NAME_MAX];
if (gethostname(this_host, sizeof(this_host)) < 0)
this_host[0] = '\0';