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];
                   ^
This commit is contained in:
Jan Beich 2021-01-19 14:41:02 +00:00 committed by Daniel Eklöf
parent 14e761179b
commit fb660262ab
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

2
uri.c
View file

@ -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';