lib: more %u for port and int for %*s fixes

Detected by Coverity

Closes #7329
This commit is contained in:
Daniel Stenberg 2021-07-01 00:21:43 +02:00
parent 6a40e6f8be
commit 1ff1d9e179
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
3 changed files with 3 additions and 3 deletions

View File

@ -980,7 +980,7 @@ CURLcode Curl_is_connected(struct Curl_easy *data,
char buffer[STRERROR_LEN];
Curl_printable_address(conn->tempaddr[i], ipaddress,
sizeof(ipaddress));
infof(data, "connect to %s port %ld failed: %s\n",
infof(data, "connect to %s port %u failed: %s\n",
ipaddress, conn->port,
Curl_strerror(error, buffer, sizeof(buffer)));
#endif

View File

@ -3868,7 +3868,7 @@ static CURLcode servercert(struct Curl_easy *data,
long len;
ASN1_TIME_print(mem, X509_get0_notBefore(backend->server_cert));
len = BIO_get_mem_data(mem, (char **) &ptr);
infof(data, " start date: %.*s\n", len, ptr);
infof(data, " start date: %.*s\n", (int)len, ptr);
(void)BIO_reset(mem);
ASN1_TIME_print(mem, X509_get0_notAfter(backend->server_cert));

View File

@ -517,7 +517,7 @@ static const char *GTime2str(const char *beg, const char *end)
return curl_maprintf("%.4s-%.2s-%.2s %.2s:%.2s:%c%c%s%.*s%s%.*s",
beg, beg + 4, beg + 6,
beg + 8, beg + 10, sec1, sec2,
fracl? ".": "", fracl, fracp,
fracl? ".": "", (int)fracl, fracp,
sep, (int)tzl, tzp);
}