From fb660262ab929688f4c7ac1fccd3d6d360ec3475 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 a0e3838a..be1e0afe 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';