Replaced HOST_NAME_MAX with portable version

This commit is contained in:
Alexander Sieg 2020-04-13 18:30:03 +02:00
parent a318fb4efa
commit 0488aa6b5e

4
osc.c
View file

@ -327,11 +327,7 @@ osc_set_pwd(struct terminal *term, char *string)
if (hostname_end == NULL)
return;
#if __linux__
char this_host[HOST_NAME_MAX];
#elif __FreeBSD__
char this_host[sysconf(_SC_HOST_NAME_MAX)];
#endif
if (gethostname(this_host, sizeof(this_host)) < 0)
this_host[0] = '\0';