lib: msnprintf tidy-ups

doh: avoid an msnprintf()

openssl: skip a superfluous return code check

Closes #15434
This commit is contained in:
Daniel Stenberg 2024-10-28 16:55:13 +01:00
parent cb011ac096
commit 080973dcdb
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 4 additions and 8 deletions

View File

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

View File

@ -2683,10 +2683,8 @@ 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, (direction == 1) ? CURLINFO_SSL_DATA_OUT :
CURLINFO_SSL_DATA_IN, (char *)buf, len);