]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tidy-up: assortment of small fixes
authorViktor Szakats <commit@vsz.me>
Thu, 21 Aug 2025 20:27:41 +0000 (22:27 +0200)
committerViktor Szakats <commit@vsz.me>
Sun, 21 Sep 2025 14:50:14 +0000 (16:50 +0200)
- examples/headerapi: fix wrong cast.
- curl_ngtcp2: delete stray character from error message.
- rustls: fix inline variable declaration.
- sendf: drop redundant `int` cast.
- libtest/cli_ws_data: drop cast with mismatched signedness.

Cherry-picked from #18343

Closes #18664

docs/examples/headerapi.c
lib/sendf.c
lib/vquic/curl_ngtcp2.c
lib/vtls/rustls.c
tests/libtest/cli_ws_data.c

index 95c366884a422b362959a70e6ace7eee83c39a3d..ede0c5cbdaedcc4f52524d9cd02a1ade6bc35e97 100644 (file)
@@ -69,7 +69,7 @@ int main(void)
       do {
         h = curl_easy_nextheader(curl, CURLH_HEADER, -1, prev);
         if(h)
-          printf(" %s: %s (%u)\n", h->name, h->value, (int)h->amount);
+          printf(" %s: %s (%u)\n", h->name, h->value, (unsigned int)h->amount);
         prev = h;
       } while(h);
 
index f759fb61a4af2cd7afe788bfcd4e84840f558278..a262d9036fd96a66a31f8e49e3cf528e84a16b8e 100644 (file)
@@ -857,7 +857,7 @@ static CURLcode cr_in_rewind(struct Curl_easy *data,
     Curl_set_in_callback(data, FALSE);
     CURL_TRC_READ(data, "cr_in, rewind via set.seek_func -> %d", err);
     if(err) {
-      failf(data, "seek callback returned error %d", (int)err);
+      failf(data, "seek callback returned error %d", err);
       return CURLE_SEND_FAIL_REWIND;
     }
   }
index 246e0d51f661f181e7676e9ae5280e7d398836e2..f902c190ef584611ce347c6508eb28784f765358 100644 (file)
@@ -1337,7 +1337,7 @@ out:
   result = Curl_1st_err(result, cf_progress_egress(cf, data, &pktx));
   result = Curl_1st_err(result, check_and_set_expiry(cf, data, &pktx));
 
-  CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_recv(blen=%zu) -> %dm, %zu",
+  CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_recv(blen=%zu) -> %d, %zu",
               stream ? stream->id : -1, blen, result, *pnread);
   CF_DATA_RESTORE(cf, save);
   return result;
index c89fadf96665fb43ea17d182be1f823a65077428..87c23544ef4c60ea6250c175d1c777d8705c726f 100644 (file)
@@ -1212,13 +1212,14 @@ cr_connect(struct Curl_cfilter *cf,
       }
       if(data->set.ssl.certinfo) {
         size_t num_certs = 0;
+        size_t i;
         while(rustls_connection_get_peer_certificate(rconn, (int)num_certs)) {
           num_certs++;
         }
         result = Curl_ssl_init_certinfo(data, (int)num_certs);
         if(result)
           return result;
-        for(size_t i = 0; i < num_certs; i++) {
+        for(i = 0; i < num_certs; i++) {
           const rustls_certificate *cert;
           const unsigned char *der_data;
           size_t der_len;
index 36d5dea25b1cd9860c8514ac8245cf0a817b245e..32356552a80761cc5ccfaa2d4df893d34b4cabd4 100644 (file)
@@ -106,7 +106,7 @@ static CURLcode test_ws_data_m2_echo(const char *url,
   curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
   curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 2L); /* websocket style */
   r = curl_easy_perform(curl);
-  curl_mfprintf(stderr, "curl_easy_perform() returned %u\n", (int)r);
+  curl_mfprintf(stderr, "curl_easy_perform() returned %u\n", r);
   if(r != CURLE_OK)
     goto out;