mirror of https://github.com/F-Stack/f-stack.git
Merge pull request #170 from yangqiang71/master
🐛 ai->ai_addr should be (struct sockaddr *)(ai+1)
This commit is contained in:
commit
86b1f8131c
|
@ -56,7 +56,7 @@ getaddrinfo(const char *hostname, const char *servername,
|
||||||
|
|
||||||
ai->ai_next = NULL;
|
ai->ai_next = NULL;
|
||||||
ai->ai_canonname = NULL;
|
ai->ai_canonname = NULL;
|
||||||
ai->ai_addr = (struct sockaddr *)ai+1;
|
ai->ai_addr = (struct sockaddr *)(ai+1);
|
||||||
|
|
||||||
struct sockaddr_in *si = (struct sockaddr_in *)ai->ai_addr;
|
struct sockaddr_in *si = (struct sockaddr_in *)ai->ai_addr;
|
||||||
si->sin_len = ai->ai_addrlen = sizeof(struct sockaddr);
|
si->sin_len = ai->ai_addrlen = sizeof(struct sockaddr);
|
||||||
|
|
Loading…
Reference in New Issue