author | Rich Felker <dalias@aerifal.cx> | 2022年10月20日 19:48:32 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2022年10月20日 19:48:32 -0400 |
commit | 8f9259450aa43a6fd539e428e61e2961b725fbae (patch) | |
tree | 3e43cbb56606528a955933c14231e743ff513bb5 | |
parent | 63402be229facae2d0de9c5943a6ed25246fd021 (diff) | |
download | musl-8f9259450aa43a6fd539e428e61e2961b725fbae.tar.gz |
-rw-r--r-- | src/network/gethostbyaddr.c | 2 | ||||
-rw-r--r-- | src/network/gethostbyname2.c | 2 |
diff --git a/src/network/gethostbyaddr.c b/src/network/gethostbyaddr.c index 598e2241..c3cacaac 100644 --- a/src/network/gethostbyaddr.c +++ b/src/network/gethostbyaddr.c @@ -20,5 +20,5 @@ struct hostent *gethostbyaddr(const void *a, socklen_t l, int af) err = gethostbyaddr_r(a, l, af, h, (void *)(h+1), size-sizeof *h, &res, &h_errno); } while (err == ERANGE); - return err ? 0 : h; + return res; } diff --git a/src/network/gethostbyname2.c b/src/network/gethostbyname2.c index dc9d6621..bd0da7f8 100644 --- a/src/network/gethostbyname2.c +++ b/src/network/gethostbyname2.c @@ -21,5 +21,5 @@ struct hostent *gethostbyname2(const char *name, int af) err = gethostbyname2_r(name, af, h, (void *)(h+1), size-sizeof *h, &res, &h_errno); } while (err == ERANGE); - return err ? 0 : h; + return res; } |