Skip to content

Commit

Permalink
Merge pull request F-Stack#170 from yangqiang71/master
Browse files Browse the repository at this point in the history
🐛 ai->ai_addr should be (struct sockaddr *)(ai+1)
  • Loading branch information
whl739 authored Mar 19, 2018
2 parents f1e85c1 + d151f2e commit 86b1f81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/compat/getaddrinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ getaddrinfo(const char *hostname, const char *servername,

ai->ai_next = 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;
si->sin_len = ai->ai_addrlen = sizeof(struct sockaddr);
Expand Down

0 comments on commit 86b1f81

Please sign in to comment.