From d567cca1de689fb08da3557f81e7cae34257e438 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 27 Apr 2023 16:29:45 +0200 Subject: checksrc: fix SPACEBEFOREPAREN for conditions starting with "*" The open paren check wants to warn for spaces before open parenthesis for if/while/for but also for any function call. In order to avoid catching function pointer declarations, the logic allows a space if the first character after the open parenthesis is an asterisk. I also spotted what we did not include "switch" in the check but we should. This check is a little lame, but we reduce this problem by not allowing that space for if/while/for/switch. Reported-by: Emanuele Torre Closes #11044 --- lib/vtls/bearssl.c | 2 +- lib/vtls/sectransp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/vtls') diff --git a/lib/vtls/bearssl.c b/lib/vtls/bearssl.c index a3a557c48..2b666ca6f 100644 --- a/lib/vtls/bearssl.c +++ b/lib/vtls/bearssl.c @@ -897,7 +897,7 @@ static ssize_t bearssl_send(struct Curl_cfilter *cf, struct Curl_easy *data, for(;;) { *err = bearssl_run_until(cf, data, BR_SSL_SENDAPP); - if (*err != CURLE_OK) + if(*err) return -1; app = br_ssl_engine_sendapp_buf(&backend->ctx.eng, &applen); if(!app) { diff --git a/lib/vtls/sectransp.c b/lib/vtls/sectransp.c index d59f2a8c0..618c0c586 100644 --- a/lib/vtls/sectransp.c +++ b/lib/vtls/sectransp.c @@ -1554,7 +1554,7 @@ static CURLcode sectransp_set_selected_ciphers(struct Curl_easy *data, } /* Find last position of a cipher in the ciphers string */ cipher_end = cipher_start; - while (*cipher_end != '\0' && !is_separator(*cipher_end)) { + while(*cipher_end != '\0' && !is_separator(*cipher_end)) { ++cipher_end; } -- cgit v1.2.1