We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26b5c29 commit 50ff9bfCopy full SHA for 50ff9bf
ip_addr.h
@@ -374,6 +374,11 @@ static inline int hostent2su( union sockaddr_union* su,
374
unsigned short port )
375
{
376
memset(su, 0, sizeof(union sockaddr_union)); /*needed on freebsd*/
377
+
378
+ /* copy the hostname into the sockaddr_union */
379
+ strncpy(su->h.hostname, he->h_name, sizeof(su->h.hostname)-1);
380
+ su->h.hostname[sizeof(su->h.hostname)-1] = 0;
381
382
su->s.sa_family=he->h_addrtype;
383
switch(he->h_addrtype){
384
case AF_INET6:
0 commit comments