projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sigtimedwait: add time64 syscall support, decouple 32-bit time_t
[musl]
/
src
/
network
/
gethostbyname2_r.c
diff --git
a/src/network/gethostbyname2_r.c
b/src/network/gethostbyname2_r.c
index
81f71d2
..
fc89487
100644
(file)
--- a/
src/network/gethostbyname2_r.c
+++ b/
src/network/gethostbyname2_r.c
@@
-34,8
+34,6
@@
int gethostbyname2_r(const char *name, int af,
case EAI_SYSTEM:
*err = NO_RECOVERY;
return errno;
case EAI_SYSTEM:
*err = NO_RECOVERY;
return errno;
- case 0:
- break;
}
h->h_addrtype = af;
}
h->h_addrtype = af;
@@
-58,6
+56,13
@@
int gethostbyname2_r(const char *name, int af,
h->h_addr_list = (void *)buf;
buf += (cnt+1)*sizeof(char *);
h->h_addr_list = (void *)buf;
buf += (cnt+1)*sizeof(char *);
+ for (i=0; i<cnt; i++) {
+ h->h_addr_list[i] = (void *)buf;
+ buf += h->h_length;
+ memcpy(h->h_addr_list[i], addrs[i].addr, h->h_length);
+ }
+ h->h_addr_list[i] = 0;
+
h->h_name = h->h_aliases[0] = buf;
strcpy(h->h_name, canon);
buf += strlen(h->h_name)+1;
h->h_name = h->h_aliases[0] = buf;
strcpy(h->h_name, canon);
buf += strlen(h->h_name)+1;
@@
-70,13
+75,6
@@
int gethostbyname2_r(const char *name, int af,
h->h_aliases[2] = 0;
h->h_aliases[2] = 0;
- for (i=0; i<cnt; i++) {
- h->h_addr_list[i] = (void *)buf;
- buf += h->h_length;
- memcpy(h->h_addr_list[i], addrs[i].addr, h->h_length);
- }
- h->h_addr_list[i] = 0;
-
*res = h;
return 0;
}
*res = h;
return 0;
}