mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 15:48:49 -05:00
checksrc: detect and remove space before trailing semicolons
This commit is contained in:
parent
0037eb5805
commit
2dc1a5ce93
@ -216,6 +216,11 @@ sub scanfile {
|
||||
checkwarn($line, length($1)+1, $file, $l, "missing space after close paren");
|
||||
}
|
||||
|
||||
# check for space before the semicolon last in a line
|
||||
if($l =~ /^(.*[^ ].*) ;$/) {
|
||||
checkwarn($line, length($1), $file, $l, "space before last semicolon");
|
||||
}
|
||||
|
||||
# scan for use of banned functions
|
||||
if($l =~ /^(.*\W)(sprintf|vsprintf|strcat|strncat|gets)\s*\(/) {
|
||||
checkwarn($line, length($1), $file, $l,
|
||||
|
@ -731,7 +731,7 @@ Curl_http_output_auth(struct connectdata *conn,
|
||||
|
||||
if((conn->bits.httpproxy && conn->bits.proxy_user_passwd) ||
|
||||
conn->bits.user_passwd)
|
||||
/* continue please */ ;
|
||||
/* continue please */;
|
||||
else {
|
||||
authhost->done = TRUE;
|
||||
authproxy->done = TRUE;
|
||||
|
@ -155,7 +155,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
|
||||
if(result) {
|
||||
/* Curl_convert_from_network calls failf if unsuccessful */
|
||||
/* Treat it as a bad hex character */
|
||||
return CHUNKE_ILLEGAL_HEX ;
|
||||
return CHUNKE_ILLEGAL_HEX;
|
||||
}
|
||||
|
||||
ch->datasize=curlx_strtoofft(ch->hexbuffer, &endptr, 16);
|
||||
|
@ -342,10 +342,10 @@ curl_socket_t curl_socket(int domain, int type, int protocol,
|
||||
int line, const char *source)
|
||||
{
|
||||
const char *fmt = (sizeof(curl_socket_t) == sizeof(int)) ?
|
||||
"FD %s:%d socket() = %d\n" :
|
||||
(sizeof(curl_socket_t) == sizeof(long)) ?
|
||||
"FD %s:%d socket() = %ld\n" :
|
||||
"FD %s:%d socket() = %zd\n" ;
|
||||
"FD %s:%d socket() = %d\n" :
|
||||
(sizeof(curl_socket_t) == sizeof(long)) ?
|
||||
"FD %s:%d socket() = %ld\n" :
|
||||
"FD %s:%d socket() = %zd\n";
|
||||
|
||||
curl_socket_t sockfd = socket(domain, type, protocol);
|
||||
|
||||
@ -361,10 +361,10 @@ int curl_socketpair(int domain, int type, int protocol,
|
||||
int line, const char *source)
|
||||
{
|
||||
const char *fmt = (sizeof(curl_socket_t) == sizeof(int)) ?
|
||||
"FD %s:%d socketpair() = %d %d\n" :
|
||||
(sizeof(curl_socket_t) == sizeof(long)) ?
|
||||
"FD %s:%d socketpair() = %ld %ld\n" :
|
||||
"FD %s:%d socketpair() = %zd %zd\n" ;
|
||||
"FD %s:%d socketpair() = %d %d\n" :
|
||||
(sizeof(curl_socket_t) == sizeof(long)) ?
|
||||
"FD %s:%d socketpair() = %ld %ld\n" :
|
||||
"FD %s:%d socketpair() = %zd %zd\n";
|
||||
|
||||
int res = socketpair(domain, type, protocol, socket_vector);
|
||||
|
||||
@ -379,10 +379,10 @@ curl_socket_t curl_accept(curl_socket_t s, void *saddr, void *saddrlen,
|
||||
int line, const char *source)
|
||||
{
|
||||
const char *fmt = (sizeof(curl_socket_t) == sizeof(int)) ?
|
||||
"FD %s:%d accept() = %d\n" :
|
||||
(sizeof(curl_socket_t) == sizeof(long)) ?
|
||||
"FD %s:%d accept() = %ld\n" :
|
||||
"FD %s:%d accept() = %zd\n" ;
|
||||
"FD %s:%d accept() = %d\n" :
|
||||
(sizeof(curl_socket_t) == sizeof(long)) ?
|
||||
"FD %s:%d accept() = %ld\n" :
|
||||
"FD %s:%d accept() = %zd\n";
|
||||
|
||||
struct sockaddr *addr = (struct sockaddr *)saddr;
|
||||
curl_socklen_t *addrlen = (curl_socklen_t *)saddrlen;
|
||||
@ -399,10 +399,10 @@ curl_socket_t curl_accept(curl_socket_t s, void *saddr, void *saddrlen,
|
||||
void curl_mark_sclose(curl_socket_t sockfd, int line, const char *source)
|
||||
{
|
||||
const char *fmt = (sizeof(curl_socket_t) == sizeof(int)) ?
|
||||
"FD %s:%d sclose(%d)\n" :
|
||||
(sizeof(curl_socket_t) == sizeof(long)) ?
|
||||
"FD %s:%d sclose(%ld)\n" :
|
||||
"FD %s:%d sclose(%zd)\n" ;
|
||||
"FD %s:%d sclose(%d)\n":
|
||||
(sizeof(curl_socket_t) == sizeof(long)) ?
|
||||
"FD %s:%d sclose(%ld)\n":
|
||||
"FD %s:%d sclose(%zd)\n";
|
||||
|
||||
if(source)
|
||||
curl_memlog(fmt, source, line, sockfd);
|
||||
|
@ -145,8 +145,8 @@ typedef struct tftp_state_data {
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event) ;
|
||||
static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event) ;
|
||||
static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event);
|
||||
static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event);
|
||||
static CURLcode tftp_connect(struct connectdata *conn, bool *done);
|
||||
static CURLcode tftp_disconnect(struct connectdata *conn,
|
||||
bool dead_connection);
|
||||
@ -218,7 +218,7 @@ static CURLcode tftp_set_timeouts(tftp_state_data_t *state)
|
||||
state->max_time = state->start_time+maxtime;
|
||||
|
||||
/* Set per-block timeout to total */
|
||||
timeout = maxtime ;
|
||||
timeout = maxtime;
|
||||
|
||||
/* Average restart after 5 seconds */
|
||||
state->retry_max = (int)timeout/5;
|
||||
|
@ -1236,7 +1236,7 @@ static CURLcode verifyhost(struct connectdata *conn, X509 *server_cert)
|
||||
unsigned char *nulstr = (unsigned char *)"";
|
||||
unsigned char *peer_CN = nulstr;
|
||||
|
||||
X509_NAME *name = X509_get_subject_name(server_cert) ;
|
||||
X509_NAME *name = X509_get_subject_name(server_cert);
|
||||
if(name)
|
||||
while((j = X509_NAME_get_index_by_NID(name, NID_commonName, i))>=0)
|
||||
i=j;
|
||||
|
@ -496,7 +496,7 @@ polarssl_connect_step3(struct connectdata *conn,
|
||||
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
|
||||
struct SessionHandle *data = conn->data;
|
||||
void *old_ssl_sessionid = NULL;
|
||||
ssl_session *our_ssl_sessionid = &conn->ssl[sockindex].ssn ;
|
||||
ssl_session *our_ssl_sessionid = &conn->ssl[sockindex].ssn;
|
||||
bool incache;
|
||||
|
||||
DEBUGASSERT(ssl_connect_3 == connssl->connecting_state);
|
||||
|
@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
@ -51,7 +51,7 @@ typedef struct {
|
||||
int padlength;
|
||||
unsigned long ptr_n;
|
||||
unsigned long step;
|
||||
} NumRange ;
|
||||
} NumRange;
|
||||
} content;
|
||||
} URLPattern;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user