mirror of
https://github.com/curl/curl.git
synced 2026-08-26 09:13:32 +03:00
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
This commit is contained in:
parent
4578ada4a0
commit
d567cca1de
14 changed files with 22 additions and 20 deletions
|
|
@ -1096,7 +1096,7 @@ static CURLcode cf_h1_proxy_connect(struct Curl_cfilter *cf,
|
|||
|
||||
out:
|
||||
*done = (result == CURLE_OK) && tunnel_is_established(cf->ctx);
|
||||
if (*done) {
|
||||
if(*done) {
|
||||
cf->connected = TRUE;
|
||||
tunnel_free(cf, data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -293,8 +293,8 @@ bool Curl_conn_cf_discard_sub(struct Curl_cfilter *cf,
|
|||
|
||||
/* remove from sub-chain and destroy */
|
||||
DEBUGASSERT(cf);
|
||||
while (*pprev) {
|
||||
if (*pprev == cf) {
|
||||
while(*pprev) {
|
||||
if(*pprev == cf) {
|
||||
*pprev = discard->next;
|
||||
discard->next = NULL;
|
||||
found = TRUE;
|
||||
|
|
|
|||
|
|
@ -548,7 +548,7 @@ static CURLcode baller_connect(struct Curl_cfilter *cf,
|
|||
baller->result = Curl_conn_cf_connect(baller->cf, data, 0, connected);
|
||||
|
||||
if(!baller->result) {
|
||||
if (*connected) {
|
||||
if(*connected) {
|
||||
baller->connected = TRUE;
|
||||
baller->is_done = TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4180,7 +4180,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data)
|
|||
size_t dirAlloc = 0;
|
||||
const char *str = rawPath;
|
||||
for(; *str != 0; ++str)
|
||||
if (*str == '/')
|
||||
if(*str == '/')
|
||||
++dirAlloc;
|
||||
|
||||
if(dirAlloc) {
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname,
|
|||
p++;
|
||||
if(*p == ';')
|
||||
p++;
|
||||
} while (*p);
|
||||
} while(*p);
|
||||
|
||||
if(!gotma)
|
||||
/* max-age is mandatory */
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ static CURLcode make_headers(struct Curl_easy *data,
|
|||
}
|
||||
|
||||
|
||||
if (*content_sha256_header) {
|
||||
if(*content_sha256_header) {
|
||||
tmp_head = curl_slist_append(head, content_sha256_header);
|
||||
if(!tmp_head)
|
||||
goto fail;
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ static int dprintf_Pass1(const char *format, struct va_stack *vto,
|
|||
/* out of allowed range */
|
||||
return 1;
|
||||
|
||||
switch (*fmt) {
|
||||
switch(*fmt) {
|
||||
case 'S':
|
||||
flags |= FLAGS_ALT;
|
||||
/* FALLTHROUGH */
|
||||
|
|
|
|||
|
|
@ -678,7 +678,7 @@ static int ipv4_normalize(struct dynbuf *host)
|
|||
parts[n] = l;
|
||||
c = endp;
|
||||
|
||||
switch (*c) {
|
||||
switch(*c) {
|
||||
case '.' :
|
||||
if(n == 3)
|
||||
return HOST_BAD;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue