From 367a66b1300c04470fddca5ab8bd986e6ffe3da8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 2 Aug 2023 16:02:48 +0200 Subject: [PATCH] lib: fix a few *printf() flag mistakes Reported-by: Gisle Vanem Ref: #11574 Closes #11579 --- lib/strerror.c | 2 +- lib/vtls/x509asn1.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/strerror.c b/lib/strerror.c index bd9cc535c..be4191414 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -938,7 +938,7 @@ const char *Curl_winapi_strerror(DWORD err, char *buf, size_t buflen) #ifndef CURL_DISABLE_VERBOSE_STRINGS if(!get_winapi_error(err, buf, buflen)) { - msnprintf(buf, buflen, "Unknown error %u (0x%08X)", err, err); + msnprintf(buf, buflen, "Unknown error %lu (0x%08lX)", err, err); } #else { diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c index f02868cbe..a3feba26d 100644 --- a/lib/vtls/x509asn1.c +++ b/lib/vtls/x509asn1.c @@ -973,7 +973,7 @@ static int do_pubkey(struct Curl_easy *data, int certnum, infof(data, " ECC Public Key (%lu bits)", len); if(data->set.ssl.certinfo) { char q[sizeof(len) * 8 / 3 + 1]; - (void)msnprintf(q, sizeof(q), "%lu", len); + (void)msnprintf(q, sizeof(q), "%zu", len); if(ssl_push_certinfo(data, certnum, "ECC Public Key", q)) return 1; } @@ -1007,7 +1007,7 @@ static int do_pubkey(struct Curl_easy *data, int certnum, infof(data, " RSA Public Key (%lu bits)", len); if(data->set.ssl.certinfo) { char r[sizeof(len) * 8 / 3 + 1]; - msnprintf(r, sizeof(r), "%lu", len); + msnprintf(r, sizeof(r), "%zu", len); if(ssl_push_certinfo(data, certnum, "RSA Public Key", r)) return 1; }