summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-12-23 23:41:13 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-12-25 23:42:16 +0100
commitaba01da6390894c9e7ebb6691da544bc01b6324d (patch)
treecccdc610b043e065e479eefb53a72893d0e06e64
parent78617b48e46e5934d94c155e0b4565978341bfe6 (diff)
downloadcurl-aba01da6390894c9e7ebb6691da544bc01b6324d.tar.gz
failf: remove newline from formatting strings
... as failf adds one itself. Also: add an assert() to failf() that triggers on a newline in the format string! Closes #6365
-rw-r--r--lib/asyn-thread.c4
-rw-r--r--lib/c-hyper.c18
-rw-r--r--lib/doh.c2
-rw-r--r--lib/ftp.c2
-rw-r--r--lib/http.c4
-rw-r--r--lib/http2.c6
-rw-r--r--lib/imap.c2
-rw-r--r--lib/sendf.c1
-rw-r--r--lib/socks.c6
-rw-r--r--lib/socks_gssapi.c2
-rw-r--r--lib/tftp.c2
-rw-r--r--lib/url.c4
-rw-r--r--lib/vauth/digest_sspi.c4
-rw-r--r--lib/vauth/krb5_sspi.c2
-rw-r--r--lib/vauth/ntlm_sspi.c2
-rw-r--r--lib/vauth/spnego_sspi.c2
-rw-r--r--lib/vquic/ngtcp2.c20
-rw-r--r--lib/vquic/quiche.c4
-rw-r--r--lib/vssh/libssh2.c4
-rw-r--r--lib/vssh/wolfssh.c4
-rw-r--r--lib/vtls/bearssl.c4
-rw-r--r--lib/vtls/mbedtls.c8
-rw-r--r--lib/vtls/openssl.c2
-rw-r--r--lib/vtls/wolfssl.c4
24 files changed, 57 insertions, 56 deletions
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
index 7c8598274..4f4685070 100644
--- a/lib/asyn-thread.c
+++ b/lib/asyn-thread.c
@@ -711,7 +711,7 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
return NULL;
}
- failf(conn->data, "getaddrinfo() thread failed\n");
+ failf(conn->data, "getaddrinfo() thread failed");
return NULL;
}
@@ -766,7 +766,7 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
return NULL;
}
- failf(data, "getaddrinfo() thread failed to start\n");
+ failf(data, "getaddrinfo() thread failed to start");
return NULL;
}
diff --git a/lib/c-hyper.c b/lib/c-hyper.c
index c7995d9f1..5df2f0e19 100644
--- a/lib/c-hyper.c
+++ b/lib/c-hyper.c
@@ -340,7 +340,7 @@ static CURLcode hyperstream(struct Curl_easy *data,
h->init = TRUE;
*didwhat = KEEP_RECV;
if(!resp) {
- failf(data, "hyperstream: couldn't get response\n");
+ failf(data, "hyperstream: couldn't get response");
return CURLE_RECV_ERROR;
}
@@ -356,7 +356,7 @@ static CURLcode hyperstream(struct Curl_easy *data,
headers = hyper_response_headers(resp);
if(!headers) {
- failf(data, "hyperstream: couldn't get response headers\n");
+ failf(data, "hyperstream: couldn't get response headers");
result = CURLE_RECV_ERROR;
break;
}
@@ -369,20 +369,20 @@ static CURLcode hyperstream(struct Curl_easy *data,
}
if(empty_header(data)) {
- failf(data, "hyperstream: couldn't pass blank header\n");
+ failf(data, "hyperstream: couldn't pass blank header");
result = CURLE_OUT_OF_MEMORY;
break;
}
resp_body = hyper_response_body(resp);
if(!resp_body) {
- failf(data, "hyperstream: couldn't get response body\n");
+ failf(data, "hyperstream: couldn't get response body");
result = CURLE_RECV_ERROR;
break;
}
foreach = hyper_body_foreach(resp_body, hyper_body_chunk, data);
if(!foreach) {
- failf(data, "hyperstream: body foreach failed\n");
+ failf(data, "hyperstream: body foreach failed");
result = CURLE_OUT_OF_MEMORY;
break;
}
@@ -467,7 +467,7 @@ CURLcode Curl_hyper_header(struct Curl_easy *data, hyper_headers *headers,
if(HYPERE_OK != hyper_headers_add(headers, (uint8_t *)n, nlen,
(uint8_t *)v, vlen)) {
- failf(data, "hyper_headers_add host\n");
+ failf(data, "hyper_headers_add host");
return CURLE_OUT_OF_MEMORY;
}
if(data->set.verbose) {
@@ -505,7 +505,7 @@ static CURLcode request_target(struct Curl_easy *data,
if(hyper_request_set_uri(req, (uint8_t *)Curl_dyn_uptr(&r),
Curl_dyn_len(&r))) {
- failf(data, "error setting path\n");
+ failf(data, "error setting path");
result = CURLE_OUT_OF_MEMORY;
}
else
@@ -758,7 +758,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
headers = hyper_request_headers(req);
if(!headers) {
- failf(data, "hyper_request_headers\n");
+ failf(data, "hyper_request_headers");
goto error;
}
@@ -829,7 +829,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
data->req.upload_chunky = FALSE;
sendtask = hyper_clientconn_send(client, req);
if(!sendtask) {
- failf(data, "hyper_clientconn_send\n");
+ failf(data, "hyper_clientconn_send");
goto error;
}
diff --git a/lib/doh.c b/lib/doh.c
index c2b76de53..41d34dd30 100644
--- a/lib/doh.c
+++ b/lib/doh.c
@@ -225,7 +225,7 @@ static CURLcode dohprobe(struct Curl_easy *data,
DOHcode d = doh_encode(host, dnstype, p->dohbuffer, sizeof(p->dohbuffer),
&p->dohlen);
if(d) {
- failf(data, "Failed to encode DOH packet [%d]\n", d);
+ failf(data, "Failed to encode DOH packet [%d]", d);
return CURLE_OUT_OF_MEMORY;
}
diff --git a/lib/ftp.c b/lib/ftp.c
index bc3557421..74f9e020a 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1768,7 +1768,7 @@ static CURLcode ftp_epsv_disable(struct connectdata *conn)
#endif
) {
/* We can't disable EPSV when doing IPv6, so this is instead a fail */
- failf(conn->data, "Failed EPSV attempt, exiting\n");
+ failf(conn->data, "Failed EPSV attempt, exiting");
return CURLE_WEIRD_SERVER_REPLY;
}
diff --git a/lib/http.c b/lib/http.c
index 3f7f4ba21..691c0937f 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -3743,7 +3743,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
k->badheader = HEADER_ALLBAD;
streamclose(conn, "bad HTTP: No end-of-message indicator");
if(!data->set.http09_allowed) {
- failf(data, "Received HTTP/0.9 when not allowed\n");
+ failf(data, "Received HTTP/0.9 when not allowed");
return CURLE_UNSUPPORTED_PROTOCOL;
}
break;
@@ -3778,7 +3778,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
streamclose(conn, "bad HTTP: No end-of-message indicator");
/* this is not the beginning of a protocol first header line */
if(!data->set.http09_allowed) {
- failf(data, "Received HTTP/0.9 when not allowed\n");
+ failf(data, "Received HTTP/0.9 when not allowed");
return CURLE_UNSUPPORTED_PROTOCOL;
}
k->header = FALSE;
diff --git a/lib/http2.c b/lib/http2.c
index 7a337a7f3..7ed708e10 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -542,7 +542,7 @@ static int push_promise(struct Curl_easy *data,
stream = data->req.p.http;
if(!stream) {
- failf(data, "Internal NULL stream!\n");
+ failf(data, "Internal NULL stream!");
(void)Curl_close(&newhandle);
rv = CURL_PUSH_DENY;
goto fail;
@@ -957,7 +957,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
stream = data_s->req.p.http;
if(!stream) {
- failf(data_s, "Internal NULL stream! 5\n");
+ failf(data_s, "Internal NULL stream!");
return NGHTTP2_ERR_CALLBACK_FAILURE;
}
@@ -1341,7 +1341,7 @@ static int h2_process_pending_input(struct connectdata *conn,
if(rv < 0) {
failf(data,
"h2_process_pending_input: nghttp2_session_mem_recv() returned "
- "%zd:%s\n", rv, nghttp2_strerror((int)rv));
+ "%zd:%s", rv, nghttp2_strerror((int)rv));
*err = CURLE_RECV_ERROR;
return -1;
}
diff --git a/lib/imap.c b/lib/imap.c
index c6dd7a232..75ab77dca 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -769,7 +769,7 @@ static CURLcode imap_perform_append(struct connectdata *conn)
/* Check we know the size of the upload */
if(data->state.infilesize < 0) {
- failf(data, "Cannot APPEND with unknown input file size\n");
+ failf(data, "Cannot APPEND with unknown input file size");
return CURLE_UPLOAD_FAILED;
}
diff --git a/lib/sendf.c b/lib/sendf.c
index 04cc725f5..adcee89f8 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -267,6 +267,7 @@ void Curl_infof(struct Curl_easy *data, const char *fmt, ...)
void Curl_failf(struct Curl_easy *data, const char *fmt, ...)
{
+ DEBUGASSERT(!strchr(fmt, '\n'));
if(data->set.verbose || data->set.errorbuffer) {
va_list ap;
size_t len;
diff --git a/lib/socks.c b/lib/socks.c
index a2d1e621f..301c6a966 100644
--- a/lib/socks.c
+++ b/lib/socks.c
@@ -298,7 +298,7 @@ CURLproxycode Curl_SOCKS4(const char *proxy_user,
}
else {
hp = NULL; /* fail! */
- failf(data, "SOCKS4 connection to %s not supported\n", buf);
+ failf(data, "SOCKS4 connection to %s not supported", buf);
}
Curl_resolv_unlock(data, dns); /* not used anymore from now on */
@@ -319,7 +319,7 @@ CURLproxycode Curl_SOCKS4(const char *proxy_user,
if(proxy_user) {
size_t plen = strlen(proxy_user);
if(plen >= sizeof(sx->socksreq) - 8) {
- failf(data, "Too long SOCKS proxy user name, can't use!\n");
+ failf(data, "Too long SOCKS proxy user name, can't use!");
return CURLPX_LONG_USER;
}
/* copy the proxy name WITH trailing zero */
@@ -839,7 +839,7 @@ CURLproxycode Curl_SOCKS5(const char *proxy_user,
#endif
else {
hp = NULL; /* fail! */
- failf(data, "SOCKS5 connection to %s not supported\n", dest);
+ failf(data, "SOCKS5 connection to %s not supported", dest);
}
Curl_resolv_unlock(data, dns); /* not used anymore from now on */
diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c
index a96579692..9d37b9bd9 100644
--- a/lib/socks_gssapi.c
+++ b/lib/socks_gssapi.c
@@ -92,7 +92,7 @@ static int check_gss_err(struct Curl_easy *data,
}
gss_release_buffer(&min_stat, &status_string);
}
- failf(data, "GSS-API error: %s failed:\n%s", function, buf);
+ failf(data, "GSS-API error: %s failed: %s", function, buf);
return 1;
}
diff --git a/lib/tftp.c b/lib/tftp.c
index fba3f5e8c..ba7c38b25 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -493,7 +493,7 @@ static CURLcode tftp_send_first(struct tftp_state_data *state,
return result;
if(strlen(filename) > (state->blksize - strlen(mode) - 4)) {
- failf(data, "TFTP file name too long\n");
+ failf(data, "TFTP file name too long");
free(filename);
return CURLE_TFTP_ILLEGAL; /* too long file name field */
}
diff --git a/lib/url.c b/lib/url.c
index a340213ad..b998c5efb 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1550,7 +1550,7 @@ CURLcode Curl_idnconvert_hostname(struct connectdata *conn,
host->name = host->encalloc;
}
else {
- failf(data, "Failed to convert %s to ACE; %s\n", host->name,
+ failf(data, "Failed to convert %s to ACE; %s", host->name,
idn2_strerror(rc));
return CURLE_URL_MALFORMAT;
}
@@ -1565,7 +1565,7 @@ CURLcode Curl_idnconvert_hostname(struct connectdata *conn,
}
else {
char buffer[STRERROR_LEN];
- failf(data, "Failed to convert %s to ACE; %s\n", host->name,
+ failf(data, "Failed to convert %s to ACE; %s", host->name,
Curl_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
return CURLE_URL_MALFORMAT;
}
diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c
index f07581ec7..dad947a37 100644
--- a/lib/vauth/digest_sspi.c
+++ b/lib/vauth/digest_sspi.c
@@ -135,7 +135,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
if(status != SEC_E_OK) {
free(input_token);
- failf(data, "SSPI: couldn't get auth info\n");
+ failf(data, "SSPI: couldn't get auth info");
return CURLE_AUTH_ERROR;
}
@@ -439,7 +439,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_DIGEST),
&SecurityPackage);
if(status != SEC_E_OK) {
- failf(data, "SSPI: couldn't get auth info\n");
+ failf(data, "SSPI: couldn't get auth info");
return CURLE_AUTH_ERROR;
}
diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c
index 8e56a8240..b2d163534 100644
--- a/lib/vauth/krb5_sspi.c
+++ b/lib/vauth/krb5_sspi.c
@@ -125,7 +125,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
TEXT(SP_NAME_KERBEROS),
&SecurityPackage);
if(status != SEC_E_OK) {
- failf(data, "SSPI: couldn't get auth info\n");
+ failf(data, "SSPI: couldn't get auth info");
return CURLE_AUTH_ERROR;
}
diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c
index 28bc3efda..07dc97398 100644
--- a/lib/vauth/ntlm_sspi.c
+++ b/lib/vauth/ntlm_sspi.c
@@ -106,7 +106,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data,
status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_NTLM),
&SecurityPackage);
if(status != SEC_E_OK) {
- failf(data, "SSPI: couldn't get auth info\n");
+ failf(data, "SSPI: couldn't get auth info");
return CURLE_AUTH_ERROR;
}
diff --git a/lib/vauth/spnego_sspi.c b/lib/vauth/spnego_sspi.c
index e7482a43e..4aa1ba957 100644
--- a/lib/vauth/spnego_sspi.c
+++ b/lib/vauth/spnego_sspi.c
@@ -130,7 +130,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
TEXT(SP_NAME_NEGOTIATE),
&SecurityPackage);
if(nego->status != SEC_E_OK) {
- failf(data, "SSPI: couldn't get auth info\n");
+ failf(data, "SSPI: couldn't get auth info");
return CURLE_AUTH_ERROR;
}
diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c
index 5a017b622..3b401ef15 100644
--- a/lib/vquic/ngtcp2.c
+++ b/lib/vquic/ngtcp2.c
@@ -587,7 +587,7 @@ static int cb_recv_stream_data(ngtcp2_conn *tconn, uint32_t flags,
nconsumed =
nghttp3_conn_read_stream(qs->h3conn, stream_id, buf, buflen, fin);
if(nconsumed < 0) {
- failf(qs->conn->data, "nghttp3_conn_read_stream returned error: %s\n",
+ failf(qs->conn->data, "nghttp3_conn_read_stream returned error: %s",
nghttp3_strerror((int)nconsumed));
return NGTCP2_ERR_CALLBACK_FAILURE;
}
@@ -616,7 +616,7 @@ cb_acked_stream_data_offset(ngtcp2_conn *tconn, int64_t stream_id,
rv = nghttp3_conn_add_ack_offset(qs->h3conn, stream_id, datalen);
if(rv != 0) {
- failf(qs->conn->data, "nghttp3_conn_add_ack_offset returned error: %s\n",
+ failf(qs->conn->data, "nghttp3_conn_add_ack_offset returned error: %s",
nghttp3_strerror(rv));
return NGTCP2_ERR_CALLBACK_FAILURE;
}
@@ -637,7 +637,7 @@ static int cb_stream_close(ngtcp2_conn *tconn, int64_t stream_id,
rv = nghttp3_conn_close_stream(qs->h3conn, stream_id,
app_error_code);
if(rv != 0) {
- failf(qs->conn->data, "nghttp3_conn_close_stream returned error: %s\n",
+ failf(qs->conn->data, "nghttp3_conn_close_stream returned error: %s",
nghttp3_strerror(rv));
return NGTCP2_ERR_CALLBACK_FAILURE;
}
@@ -658,7 +658,7 @@ static int cb_stream_reset(ngtcp2_conn *tconn, int64_t stream_id,
rv = nghttp3_conn_reset_stream(qs->h3conn, stream_id);
if(rv != 0) {
- failf(qs->conn->data, "nghttp3_conn_reset_stream returned error: %s\n",
+ failf(qs->conn->data, "nghttp3_conn_reset_stream returned error: %s",
nghttp3_strerror(rv));
return NGTCP2_ERR_CALLBACK_FAILURE;
}
@@ -689,7 +689,7 @@ static int cb_extend_max_stream_data(ngtcp2_conn *tconn, int64_t stream_id,
rv = nghttp3_conn_unblock_stream(qs->h3conn, stream_id);
if(rv != 0) {
- failf(qs->conn->data, "nghttp3_conn_unblock_stream returned error: %s\n",
+ failf(qs->conn->data, "nghttp3_conn_unblock_stream returned error: %s",
nghttp3_strerror(rv));
return NGTCP2_ERR_CALLBACK_FAILURE;
}
@@ -1783,7 +1783,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, int sockfd,
rv = ngtcp2_conn_handle_expiry(qs->qconn, ts);
if(rv != 0) {
- failf(conn->data, "ngtcp2_conn_handle_expiry returned error: %s\n",
+ failf(conn->data, "ngtcp2_conn_handle_expiry returned error: %s",
ngtcp2_strerror(rv));
return CURLE_SEND_ERROR;
}
@@ -1796,7 +1796,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, int sockfd,
veccnt = nghttp3_conn_writev_stream(qs->h3conn, &stream_id, &fin, vec,
sizeof(vec) / sizeof(vec[0]));
if(veccnt < 0) {
- failf(conn->data, "nghttp3_conn_writev_stream returned error: %s\n",
+ failf(conn->data, "nghttp3_conn_writev_stream returned error: %s",
nghttp3_strerror((int)veccnt));
return CURLE_SEND_ERROR;
}
@@ -1838,7 +1838,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, int sockfd,
}
else {
assert(ndatalen == -1);
- failf(conn->data, "ngtcp2_conn_writev_stream returned error: %s\n",
+ failf(conn->data, "ngtcp2_conn_writev_stream returned error: %s",
ngtcp2_strerror((int)outlen));
return CURLE_SEND_ERROR;
}
@@ -1852,7 +1852,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, int sockfd,
outlen = ngtcp2_conn_write_pkt(qs->qconn, &ps.path, NULL,
out, pktlen, ts);
if(outlen < 0) {
- failf(conn->data, "ngtcp2_conn_write_pkt returned error: %s\n",
+ failf(conn->data, "ngtcp2_conn_write_pkt returned error: %s",
ngtcp2_strerror((int)outlen));
return CURLE_SEND_ERROR;
}
@@ -1871,7 +1871,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, int sockfd,
break;
}
else {
- failf(conn->data, "send() returned %zd (errno %d)\n", sent,
+ failf(conn->data, "send() returned %zd (errno %d)", sent,
SOCKERRNO);
return CURLE_SEND_ERROR;
}
diff --git a/lib/vquic/quiche.c b/lib/vquic/quiche.c
index 3e913ec79..a66b66447 100644
--- a/lib/vquic/quiche.c
+++ b/lib/vquic/quiche.c
@@ -399,14 +399,14 @@ static CURLcode flush_egress(struct connectdata *conn, int sockfd,
break;
if(sent < 0) {
- failf(conn->data, "quiche_conn_send returned %zd\n",
+ failf(conn->data, "quiche_conn_send returned %zd",
sent);
return CURLE_SEND_ERROR;
}
sent = send(sockfd, out, sent, 0);
if(sent < 0) {
- failf(conn->data, "send() returned %zd\n", sent);
+ failf(conn->data, "send() returned %zd", sent);
return CURLE_SEND_ERROR;
}
} while(1);
diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c
index a69bcda99..b44c9d232 100644
--- a/lib/vssh/libssh2.c
+++ b/lib/vssh/libssh2.c
@@ -763,10 +763,10 @@ static CURLcode ssh_force_knownhost_key_type(struct connectdata *conn)
hostkey_method = hostkey_method_ssh_dss;
break;
case LIBSSH2_KNOWNHOST_KEY_RSA1:
- failf(data, "Found host key type RSA1 which is not supported\n");
+ failf(data, "Found host key type RSA1 which is not supported");
return CURLE_SSH;
default:
- failf(data, "Unknown host key type: %i\n",
+ failf(data, "Unknown host key type: %i",
(store->typemask & LIBSSH2_KNOWNHOST_KEY_MASK));
return CURLE_SSH;
}
diff --git a/lib/vssh/wolfssh.c b/lib/vssh/wolfssh.c
index b0dfb2047..5dd95546c 100644
--- a/lib/vssh/wolfssh.c
+++ b/lib/vssh/wolfssh.c
@@ -262,7 +262,7 @@ static ssize_t wsftp_send(struct connectdata *conn, int sockindex,
return -1;
}
if(rc < 0) {
- failf(conn->data, "wolfSSH_SFTP_SendWritePacket returned %d\n", rc);
+ failf(conn->data, "wolfSSH_SFTP_SendWritePacket returned %d", rc);
return -1;
}
DEBUGASSERT(rc == (int)len);
@@ -307,7 +307,7 @@ static ssize_t wsftp_recv(struct connectdata *conn, int sockindex,
DEBUGASSERT(rc <= (int)len);
if(rc < 0) {
- failf(conn->data, "wolfSSH_SFTP_SendReadPacket returned %d\n", rc);
+ failf(conn->data, "wolfSSH_SFTP_SendReadPacket returned %d", rc);
return -1;
}
sshc->offset += len;
diff --git a/lib/vtls/bearssl.c b/lib/vtls/bearssl.c
index b0c3dc2f0..421c1451f 100644
--- a/lib/vtls/bearssl.c
+++ b/lib/vtls/bearssl.c
@@ -349,8 +349,8 @@ static CURLcode bearssl_connect_step1(struct connectdata *conn, int sockindex)
ret = load_cafile(ssl_cafile, &backend->anchors, &backend->anchors_len);
if(ret != CURLE_OK) {
if(verifypeer) {
- failf(data, "error setting certificate verify locations:\n"
- " CAfile: %s\n", ssl_cafile);
+ failf(data, "error setting certificate verify locations."
+ " CAfile: %s", ssl_cafile);
return ret;
}
infof(data, "error setting certificate verify locations,"
diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c
index 191315df8..e130f192d 100644
--- a/lib/vtls/mbedtls.c
+++ b/lib/vtls/mbedtls.c
@@ -280,7 +280,7 @@ mbed_connect_step1(struct connectdata *conn,
#ifdef MBEDTLS_ERROR_C
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
#endif /* MBEDTLS_ERROR_C */
- failf(data, "Failed - mbedTLS: ctr_drbg_init returned (-0x%04X) %s\n",
+ failf(data, "Failed - mbedTLS: ctr_drbg_init returned (-0x%04X) %s",
-ret, errorbuf);
}
#else
@@ -293,7 +293,7 @@ mbed_connect_step1(struct connectdata *conn,
#ifdef MBEDTLS_ERROR_C
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
#endif /* MBEDTLS_ERROR_C */
- failf(data, "Failed - mbedTLS: ctr_drbg_init returned (-0x%04X) %s\n",
+ failf(data, "Failed - mbedTLS: ctr_drbg_init returned (-0x%04X) %s",
-ret, errorbuf);
}
#endif /* THREADING_SUPPORT */
@@ -868,7 +868,7 @@ static CURLcode Curl_mbedtls_random(struct Curl_easy *data,
#ifdef MBEDTLS_ERROR_C
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
#endif /* MBEDTLS_ERROR_C */
- failf(data, "Failed - mbedTLS: ctr_drbg_seed returned (-0x%04X) %s\n",
+ failf(data, "Failed - mbedTLS: ctr_drbg_seed returned (-0x%04X) %s",
-ret, errorbuf);
}
else {
@@ -878,7 +878,7 @@ static CURLcode Curl_mbedtls_random(struct Curl_easy *data,
#ifdef MBEDTLS_ERROR_C
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
#endif /* MBEDTLS_ERROR_C */
- failf(data, "mbedTLS: ctr_drbg_init returned (-0x%04X) %s\n",
+ failf(data, "mbedTLS: ctr_drbg_init returned (-0x%04X) %s",
-ret, errorbuf);
}
}
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index e9c535f8f..dfb5ed54d 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -1289,7 +1289,7 @@ static CURLcode Curl_ossl_set_engine(struct Curl_easy *data,
char buf[256];
ENGINE_free(e);
- failf(data, "Failed to initialise SSL Engine '%s':\n%s",
+ failf(data, "Failed to initialise SSL Engine '%s': %s",
engine, ossl_strerror(ERR_get_error(), buf, sizeof(buf)));
return CURLE_SSL_ENGINE_INITFAILED;
}
diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c
index 44ee2d9ec..3f5f0949e 100644
--- a/lib/vtls/wolfssl.c
+++ b/lib/vtls/wolfssl.c
@@ -608,7 +608,7 @@ wolfssl_connect_step2(struct connectdata *conn,
* as also mismatching CN fields */
else if(DOMAIN_NAME_MISMATCH == detail) {
#if 1
- failf(data, "\tsubject alt name(s) or common name do not match \"%s\"\n",
+ failf(data, "\tsubject alt name(s) or common name do not match \"%s\"",
dispname);
return CURLE_PEER_FAILED_VERIFICATION;
#else
@@ -635,7 +635,7 @@ wolfssl_connect_step2(struct connectdata *conn,
#if LIBWOLFSSL_VERSION_HEX >= 0x02007000 /* 2.7.0 */
else if(ASN_NO_SIGNER_E == detail) {
if(SSL_CONN_CONFIG(verifypeer)) {
- failf(data, "\tCA signer not available for verification\n");
+ failf(data, "\tCA signer not available for verification");
return CURLE_SSL_CACERT_BADFILE;
}
else {