From c531c6bc0e0e91722ec99da376d556af46b22bbc Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Tue, 19 Jan 2021 14:41:02 +0000 Subject: [PATCH] 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]; ^ --- uri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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';