mirror of
https://github.com/curl/curl.git
synced 2026-06-06 21:04:18 +03:00
tidy-up: replace (1 == expressions pton
This commit is contained in:
parent
4034bc7ebf
commit
29e22ef65b
4 changed files with 6 additions and 6 deletions
|
|
@ -260,11 +260,11 @@ static CURLcode altsvc_out(struct altsvc *as, FILE *fp)
|
|||
#ifdef USE_IPV6
|
||||
else {
|
||||
char ipv6_unused[16];
|
||||
if(1 == curlx_inet_pton(AF_INET6, as->dst.host, ipv6_unused)) {
|
||||
if(curlx_inet_pton(AF_INET6, as->dst.host, ipv6_unused) == 1) {
|
||||
dst6_pre = "[";
|
||||
dst6_post = "]";
|
||||
}
|
||||
if(1 == curlx_inet_pton(AF_INET6, as->src.host, ipv6_unused)) {
|
||||
if(curlx_inet_pton(AF_INET6, as->src.host, ipv6_unused) == 1) {
|
||||
src6_pre = "[";
|
||||
src6_post = "]";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,8 +114,8 @@ struct Curl_addrinfo *Curl_sync_getaddrinfo(struct Curl_easy *data,
|
|||
* The AI_NUMERICHOST must not be set to get synthesized IPv6 address from
|
||||
* an IPv4 address on iOS and macOS.
|
||||
*/
|
||||
if((1 == curlx_inet_pton(AF_INET, hostname, addrbuf)) ||
|
||||
(1 == curlx_inet_pton(AF_INET6, hostname, addrbuf))) {
|
||||
if((curlx_inet_pton(AF_INET, hostname, addrbuf) == 1) ||
|
||||
(curlx_inet_pton(AF_INET6, hostname, addrbuf) == 1)) {
|
||||
/* the given address is numerical only, prevent a reverse lookup */
|
||||
hints.ai_flags = AI_NUMERICHOST;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy)
|
|||
else {
|
||||
unsigned int address;
|
||||
namelen = strlen(name);
|
||||
if(1 == curlx_inet_pton(AF_INET, name, &address))
|
||||
if(curlx_inet_pton(AF_INET, name, &address) == 1)
|
||||
type = TYPE_IPV4;
|
||||
else {
|
||||
/* ignore trailing dots in the hostname */
|
||||
|
|
|
|||
|
|
@ -884,7 +884,7 @@ CONNECT_RESOLVE_REMOTE:
|
|||
}
|
||||
else
|
||||
#endif
|
||||
if(1 == curlx_inet_pton(AF_INET, sx->hostname, ip4)) {
|
||||
if(curlx_inet_pton(AF_INET, sx->hostname, ip4) == 1) {
|
||||
socksreq[len++] = 1;
|
||||
memcpy(&socksreq[len], ip4, sizeof(ip4));
|
||||
len += sizeof(ip4);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue