From 3d99136ad6d16c8281c7a65bee14efd7e57a1d77 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 25 Jul 2025 14:15:57 +0200 Subject: [PATCH] more --- lib/conncache.c | 2 +- lib/cookie.c | 4 ++-- lib/ftp.c | 2 +- lib/vtls/gtls.c | 2 +- lib/vtls/openssl.c | 2 +- tests/libtest/lib1560.c | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/conncache.c b/lib/conncache.c index fd6776e34c..f77a746874 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -515,7 +515,7 @@ static bool cpool_foreach(struct Curl_easy *data, struct connectdata *conn = Curl_node_elem(curr); curr = Curl_node_next(curr); - if(1 == func(data, conn, param)) { + if(func(data, conn, param) == 1) { return TRUE; } } diff --git a/lib/cookie.c b/lib/cookie.c index 60b2d15cb5..914a4aca12 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -872,7 +872,7 @@ parse_netscape(struct Cookie *co, break; } } - if(6 == fields) { + if(fields == 6) { /* we got a cookie with blank contents, fix it */ co->value = strdup(""); if(!co->value) @@ -881,7 +881,7 @@ parse_netscape(struct Cookie *co, fields++; } - if(7 != fields) + if(fields != 7) /* we did not find the sufficient number of fields */ return CERR_FIELDS; diff --git a/lib/ftp.c b/lib/ftp.c index dc90e5a595..a82cb473ef 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -615,7 +615,7 @@ static CURLcode ftp_readresp(struct Curl_easy *data, if(ftpcode) *ftpcode = code; - if(421 == code) { + if(code == 421) { /* 421 means "Service not available, closing control connection." and FTP * servers use it to signal that idle session timeout has been exceeded. * If we ignored the response, it could end up hanging in some cases. diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 9f5ab46659..46063a2dab 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -1986,7 +1986,7 @@ static bool gtls_data_pending(struct Curl_cfilter *cf, DEBUGASSERT(ctx && ctx->backend); backend = (struct gtls_ssl_backend_data *)ctx->backend; if(backend->gtls.session && - 0 != gnutls_record_check_pending(backend->gtls.session)) + gnutls_record_check_pending(backend->gtls.session) != 0) return TRUE; return FALSE; } diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index eda19de8aa..0477385fd9 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -975,7 +975,7 @@ static int passwd_callback(char *buf, int num, int encrypting, */ static bool rand_enough(void) { - return 0 != RAND_status(); + return RAND_status() != 0; } static CURLcode ossl_seed(struct Curl_easy *data) diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c index 62f0c00905..62e1cdd6d5 100644 --- a/tests/libtest/lib1560.c +++ b/tests/libtest/lib1560.c @@ -1888,8 +1888,8 @@ static int clear_url(void) curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); rc = curl_url_get(u, clear_url_list[i].part, &p, 0); - if(rc != clear_url_list[i].ucode || (clear_url_list[i].out && - 0 != strcmp(p, clear_url_list[i].out))) { + if(rc != clear_url_list[i].ucode || + (clear_url_list[i].out && strcmp(p, clear_url_list[i].out) != 0)) { curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); error++;