From: Daniel Stenberg Date: Mon, 28 Oct 2024 15:55:13 +0000 (+0100) Subject: lib: msnprintf tidy-ups X-Git-Tag: curl-8_11_0~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=080973dcdbfab5f81c38185568214420de38949b;p=thirdparty%2Fcurl.git lib: msnprintf tidy-ups doh: avoid an msnprintf() openssl: skip a superfluous return code check Closes #15434 --- diff --git a/lib/doh.c b/lib/doh.c index 1873d413b7..8769372e0b 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -847,11 +847,9 @@ static void doh_show(struct Curl_easy *data, } else if(a->type == DNS_TYPE_AAAA) { int j; - char buffer[128]; - char *ptr; - size_t len; - len = msnprintf(buffer, 128, "[DoH] AAAA: "); - ptr = &buffer[len]; + char buffer[128] = "[DoH] AAAA: "; + size_t len = strlen(buffer); + char *ptr = &buffer[len]; len = sizeof(buffer) - len; for(j = 0; j < 16; j += 2) { size_t l; diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index e380c2e08e..67c7fd0f79 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2683,9 +2683,7 @@ static void ossl_trace(int direction, int ssl_ver, int content_type, "%s (%s), %s, %s (%d):\n", verstr, direction ? "OUT" : "IN", tls_rt_name, msg_name, msg_type); - if(0 <= txt_len && (unsigned)txt_len < sizeof(ssl_buf)) { - Curl_debug(data, CURLINFO_TEXT, ssl_buf, (size_t)txt_len); - } + Curl_debug(data, CURLINFO_TEXT, ssl_buf, (size_t)txt_len); } Curl_debug(data, (direction == 1) ? CURLINFO_SSL_DATA_OUT :