mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 23:49:44 +08:00
Fix mg_resolve2()
PUBLISHED_FROM=b0df728a75073c6ea9fc1984bb6a6b463f539347
This commit is contained in:
parent
1fb9f922b0
commit
3fc61a3edc
@ -2708,8 +2708,8 @@ static int mg_resolve2(const char *host, struct in_addr *ina) {
|
||||
return 0;
|
||||
}
|
||||
for (p = servinfo; p != NULL; p = p->ai_next) {
|
||||
memcpy(&h, &p->ai_addr, sizeof(struct sockaddr_in *));
|
||||
memcpy(ina, &h->sin_addr, sizeof(ina));
|
||||
memcpy(&h, &p->ai_addr, sizeof(h));
|
||||
memcpy(ina, &h->sin_addr, sizeof(*ina));
|
||||
}
|
||||
freeaddrinfo(servinfo);
|
||||
return 1;
|
||||
|
@ -341,8 +341,8 @@ static int mg_resolve2(const char *host, struct in_addr *ina) {
|
||||
return 0;
|
||||
}
|
||||
for (p = servinfo; p != NULL; p = p->ai_next) {
|
||||
memcpy(&h, &p->ai_addr, sizeof(struct sockaddr_in *));
|
||||
memcpy(ina, &h->sin_addr, sizeof(ina));
|
||||
memcpy(&h, &p->ai_addr, sizeof(h));
|
||||
memcpy(ina, &h->sin_addr, sizeof(*ina));
|
||||
}
|
||||
freeaddrinfo(servinfo);
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user