tidy-up: assortment of small fixes

- 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
This commit is contained in:
Viktor Szakats 2025-08-21 22:27:41 +02:00
parent 06d00e3879
commit e5d9c871f0
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
5 changed files with 6 additions and 5 deletions

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

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

View 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;

View 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;

View 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;