(hookup): terminate string from gethostbyname

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1618 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-04-23 21:25:59 +00:00
parent cf5465840c
commit 9315440eab

View File

@@ -76,6 +76,7 @@ hookup(char *host, int port)
hp->h_addr_list[0],
sizeof(hisctladdr.sin_addr));
strncpy(hostnamebuf, hp->h_name, sizeof(hostnamebuf));
hostnamebuf[sizeof(hostnamebuf) - 1] = '\0';
}
hostname = hostnamebuf;
s = socket(hisctladdr.sin_family, SOCK_STREAM, 0);