change buffer size for gethostname() to HOST_NAME_MAX to avoid accidently truncating...