tidy-up: replace (1 == expressions pton

This commit is contained in:
Viktor Szakats 2025-07-09 19:41:34 +02:00
parent 4034bc7ebf
commit 29e22ef65b
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
4 changed files with 6 additions and 6 deletions

View file

@ -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 = "]";
}

View file

@ -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;
}

View file

@ -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 */

View file

@ -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);