From 29e22ef65bf83fb2cab50d1ef594308beea037c0 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 9 Jul 2025 19:41:34 +0200 Subject: [PATCH] tidy-up: replace `(1 == ` expressions pton --- lib/altsvc.c | 4 ++-- lib/hostip6.c | 4 ++-- lib/noproxy.c | 2 +- lib/socks.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/altsvc.c b/lib/altsvc.c index 59476d7325..a06f40bc2a 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -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 = "]"; } diff --git a/lib/hostip6.c b/lib/hostip6.c index ce7f5050ea..fa2ff33b2c 100644 --- a/lib/hostip6.c +++ b/lib/hostip6.c @@ -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; } diff --git a/lib/noproxy.c b/lib/noproxy.c index a8f855bbd1..22b067ad1b 100644 --- a/lib/noproxy.c +++ b/lib/noproxy.c @@ -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 */ diff --git a/lib/socks.c b/lib/socks.c index 79f8b15d8b..46daf53baa 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -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);