Index: src/OFDNSResolverSettings.m ================================================================== --- src/OFDNSResolverSettings.m +++ src/OFDNSResolverSettings.m @@ -64,10 +64,14 @@ # define RESOLV_CONF_PATH @"AmiTCP:db/resolv.conf" #else # define HOSTS_PATH @"/etc/hosts" # define RESOLV_CONF_PATH @"/etc/resolv.conf" #endif + +#ifndef HOST_NAME_MAX +# define HOST_NAME_MAX 255 +#endif #ifndef OF_WII static OFString * domainFromHostname(OFString *hostname) { @@ -100,13 +104,13 @@ #if !defined(OF_WII) && !defined(OF_MORPHOS) static OFString * obtainHostname(void) { - char hostname[256]; + char hostname[HOST_NAME_MAX + 1]; - if (gethostname(hostname, 256) != 0) + if (gethostname(hostname, HOST_NAME_MAX + 1) != 0) return nil; return [OFString stringWithCString: hostname encoding: [OFLocale encoding]]; }