mirror of
https://github.com/moparisthebest/curl
synced 2025-01-10 21:48:10 -05:00
checksrc: make sure sizeof() is used *with* parentheses
... and unify the source code to adhere. Closes #2563
This commit is contained in:
parent
f3d836b736
commit
cb529b713f
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2018, 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
|
||||
@ -111,7 +111,7 @@ err:
|
||||
|
||||
fprintf(stderr, "error adding certificate\n");
|
||||
if(error) {
|
||||
ERR_error_string_n(error, errbuf, sizeof errbuf);
|
||||
ERR_error_string_n(error, errbuf, sizeof(errbuf));
|
||||
fprintf(stderr, "%s\n", errbuf);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2018, 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
|
||||
@ -50,7 +50,7 @@ static curl_context_t* create_curl_context(curl_socket_t sockfd)
|
||||
{
|
||||
curl_context_t *context;
|
||||
|
||||
context = (curl_context_t *) malloc(sizeof *context);
|
||||
context = (curl_context_t *) malloc(sizeof(*context));
|
||||
|
||||
context->sockfd = sockfd;
|
||||
|
||||
|
@ -63,6 +63,7 @@ my %warnings = (
|
||||
'NOSPACEEQUALS' => 'equals sign without preceding space',
|
||||
'SEMINOSPACE' => 'semicolon without following space',
|
||||
'MULTISPACE' => 'multiple spaces used when not suitable',
|
||||
'SIZEOFNOPAREN' => 'use of sizeof without parentheses',
|
||||
);
|
||||
|
||||
sub readwhitelist {
|
||||
@ -417,6 +418,17 @@ sub scanfile {
|
||||
}
|
||||
}
|
||||
|
||||
# check for "sizeof" without parenthesis
|
||||
if(($l =~ /^(.*)sizeof *([ (])/) && ($2 ne "(")) {
|
||||
if($1 =~ / *\#/) {
|
||||
# this is a #if, treat it differently
|
||||
}
|
||||
else {
|
||||
checkwarn("SIZEOFNOPAREN", $line, length($1)+6, $file, $l,
|
||||
"sizeof without parenthesis");
|
||||
}
|
||||
}
|
||||
|
||||
# check for comma without space
|
||||
if($l =~ /^(.*),[^ \n]/) {
|
||||
my $pref=$1;
|
||||
|
@ -725,7 +725,7 @@ int curl_formget(struct curl_httppost *form, void *arg,
|
||||
|
||||
while(!result) {
|
||||
char buffer[8192];
|
||||
size_t nread = Curl_mime_read(buffer, 1, sizeof buffer, &toppart);
|
||||
size_t nread = Curl_mime_read(buffer, 1, sizeof(buffer), &toppart);
|
||||
|
||||
if(!nread)
|
||||
break;
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2018, 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
|
||||
@ -58,7 +58,7 @@ Curl_HMAC_init(const HMAC_params * hashparams,
|
||||
unsigned char b;
|
||||
|
||||
/* Create HMAC context. */
|
||||
i = sizeof *ctxt + 2 * hashparams->hmac_ctxtsize +
|
||||
i = sizeof(*ctxt) + 2 * hashparams->hmac_ctxtsize +
|
||||
hashparams->hmac_resultlen;
|
||||
ctxt = malloc(i);
|
||||
|
||||
|
@ -1406,7 +1406,7 @@ static CURLcode add_haproxy_protocol_header(struct connectdata *conn)
|
||||
}
|
||||
|
||||
snprintf(proxy_header,
|
||||
sizeof proxy_header,
|
||||
sizeof(proxy_header),
|
||||
"PROXY %s %s %s %li %li\r\n",
|
||||
tcp_version,
|
||||
conn->data->info.conn_local_ip,
|
||||
|
@ -345,7 +345,7 @@ const char *Curl_http2_strerror(uint32_t err)
|
||||
"INADEQUATE_SECURITY", /* 0xC */
|
||||
"HTTP_1_1_REQUIRED" /* 0xD */
|
||||
};
|
||||
return (err < sizeof str / sizeof str[0]) ? str[err] : "unknown";
|
||||
return (err < sizeof(str) / sizeof(str[0])) ? str[err] : "unknown";
|
||||
#else
|
||||
return nghttp2_http2_strerror(err);
|
||||
#endif
|
||||
|
@ -49,7 +49,7 @@
|
||||
*/
|
||||
static char *inet_ntop4 (const unsigned char *src, char *dst, size_t size)
|
||||
{
|
||||
char tmp[sizeof "255.255.255.255"];
|
||||
char tmp[sizeof("255.255.255.255")];
|
||||
size_t len;
|
||||
|
||||
DEBUGASSERT(size >= 16);
|
||||
|
@ -527,7 +527,7 @@ MD5_context *Curl_MD5_init(const MD5_params *md5params)
|
||||
MD5_context *ctxt;
|
||||
|
||||
/* Create MD5 context */
|
||||
ctxt = malloc(sizeof *ctxt);
|
||||
ctxt = malloc(sizeof(*ctxt));
|
||||
|
||||
if(!ctxt)
|
||||
return ctxt;
|
||||
|
12
lib/mime.c
12
lib/mime.c
@ -787,10 +787,10 @@ static size_t read_encoded_part_content(curl_mimepart *part,
|
||||
st->bufbeg = 0;
|
||||
st->bufend = len;
|
||||
}
|
||||
if(st->bufend >= sizeof st->buf)
|
||||
if(st->bufend >= sizeof(st->buf))
|
||||
return cursize? cursize: READ_ERROR; /* Buffer full. */
|
||||
sz = read_part_content(part, st->buf + st->bufend,
|
||||
sizeof st->buf - st->bufend);
|
||||
sizeof(st->buf) - st->bufend);
|
||||
switch(sz) {
|
||||
case 0:
|
||||
ateof = TRUE;
|
||||
@ -1220,7 +1220,7 @@ curl_mime *curl_mime_init(struct Curl_easy *easy)
|
||||
{
|
||||
curl_mime *mime;
|
||||
|
||||
mime = (curl_mime *) malloc(sizeof *mime);
|
||||
mime = (curl_mime *) malloc(sizeof(*mime));
|
||||
|
||||
if(mime) {
|
||||
mime->easy = easy;
|
||||
@ -1247,7 +1247,7 @@ curl_mime *curl_mime_init(struct Curl_easy *easy)
|
||||
/* Initialize a mime part. */
|
||||
void Curl_mime_initpart(curl_mimepart *part, struct Curl_easy *easy)
|
||||
{
|
||||
memset((char *) part, 0, sizeof *part);
|
||||
memset((char *) part, 0, sizeof(*part));
|
||||
part->easy = easy;
|
||||
mimesetstate(&part->state, MIMESTATE_BEGIN, NULL);
|
||||
}
|
||||
@ -1260,7 +1260,7 @@ curl_mimepart *curl_mime_addpart(curl_mime *mime)
|
||||
if(!mime)
|
||||
return NULL;
|
||||
|
||||
part = (curl_mimepart *) malloc(sizeof *part);
|
||||
part = (curl_mimepart *) malloc(sizeof(*part));
|
||||
|
||||
if(part) {
|
||||
Curl_mime_initpart(part, mime->easy);
|
||||
@ -1670,7 +1670,7 @@ const char *Curl_mime_contenttype(const char *filename)
|
||||
size_t len1 = strlen(filename);
|
||||
const char *nameend = filename + len1;
|
||||
|
||||
for(i = 0; i < sizeof ctts / sizeof ctts[0]; i++) {
|
||||
for(i = 0; i < sizeof(ctts) / sizeof(ctts[0]); i++) {
|
||||
size_t len2 = strlen(ctts[i].extension);
|
||||
|
||||
if(len1 >= len2 && strcasecompare(nameend - len2, ctts[i].extension))
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2018, 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
|
||||
@ -76,7 +76,7 @@
|
||||
} WHILE_FALSE
|
||||
#define CURL_SB_ACCUM(x,c) \
|
||||
do { \
|
||||
if(x->subpointer < (x->subbuffer + sizeof x->subbuffer)) \
|
||||
if(x->subpointer < (x->subbuffer + sizeof(x->subbuffer))) \
|
||||
*x->subpointer++ = (c); \
|
||||
} WHILE_FALSE
|
||||
|
||||
|
@ -445,7 +445,7 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
|
||||
|
||||
#ifdef HAVE_BROTLI
|
||||
version_info.brotli_ver_num = BrotliDecoderVersion();
|
||||
brotli_version(brotli_buffer, sizeof brotli_buffer);
|
||||
brotli_version(brotli_buffer, sizeof(brotli_buffer));
|
||||
version_info.brotli_version = brotli_buffer;
|
||||
#endif
|
||||
|
||||
|
@ -569,7 +569,7 @@ cyassl_connect_step2(struct connectdata *conn,
|
||||
return CURLE_SSL_PINNEDPUBKEYNOTMATCH;
|
||||
}
|
||||
|
||||
memset(&x509_parsed, 0, sizeof x509_parsed);
|
||||
memset(&x509_parsed, 0, sizeof(x509_parsed));
|
||||
if(Curl_parseX509(&x509_parsed, x509_der, x509_der + x509_der_len))
|
||||
return CURLE_SSL_PINNEDPUBKEYNOTMATCH;
|
||||
|
||||
|
@ -328,7 +328,7 @@ static CURLcode set_ciphers(struct connectdata *conn,
|
||||
GSKit tokens are always shorter than their cipher names, allocated buffers
|
||||
will always be large enough to accommodate the result. */
|
||||
l = strlen(cipherlist) + 1;
|
||||
memset((char *) ciphers, 0, sizeof ciphers);
|
||||
memset((char *) ciphers, 0, sizeof(ciphers));
|
||||
for(i = 0; i < CURL_GSKPROTO_LAST; i++) {
|
||||
ciphers[i].buf = malloc(l);
|
||||
if(!ciphers[i].buf) {
|
||||
@ -536,18 +536,18 @@ inetsocketpair(int sv[2])
|
||||
lfd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if(lfd < 0)
|
||||
return -1;
|
||||
memset((char *) &addr1, 0, sizeof addr1);
|
||||
memset((char *) &addr1, 0, sizeof(addr1));
|
||||
addr1.sin_family = AF_INET;
|
||||
addr1.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||
addr1.sin_port = 0;
|
||||
if(bind(lfd, (struct sockaddr *) &addr1, sizeof addr1) ||
|
||||
if(bind(lfd, (struct sockaddr *) &addr1, sizeof(addr1)) ||
|
||||
listen(lfd, 2) < 0) {
|
||||
close(lfd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Get the allocated port. */
|
||||
len = sizeof addr1;
|
||||
len = sizeof(addr1);
|
||||
if(getsockname(lfd, (struct sockaddr *) &addr1, &len) < 0) {
|
||||
close(lfd);
|
||||
return -1;
|
||||
@ -562,7 +562,7 @@ inetsocketpair(int sv[2])
|
||||
|
||||
/* Request unblocking connection to the listening socket. */
|
||||
curlx_nonblock(cfd, TRUE);
|
||||
if(connect(cfd, (struct sockaddr *) &addr1, sizeof addr1) < 0 &&
|
||||
if(connect(cfd, (struct sockaddr *) &addr1, sizeof(addr1)) < 0 &&
|
||||
errno != EINPROGRESS) {
|
||||
close(lfd);
|
||||
close(cfd);
|
||||
@ -570,7 +570,7 @@ inetsocketpair(int sv[2])
|
||||
}
|
||||
|
||||
/* Get the client dynamic port for intrusion check below. */
|
||||
len = sizeof addr2;
|
||||
len = sizeof(addr2);
|
||||
if(getsockname(cfd, (struct sockaddr *) &addr2, &len) < 0) {
|
||||
close(lfd);
|
||||
close(cfd);
|
||||
@ -580,7 +580,7 @@ inetsocketpair(int sv[2])
|
||||
/* Accept the incoming connection and get the server socket. */
|
||||
curlx_nonblock(lfd, TRUE);
|
||||
for(;;) {
|
||||
len = sizeof addr1;
|
||||
len = sizeof(addr1);
|
||||
sfd = accept(lfd, (struct sockaddr *) &addr1, &len);
|
||||
if(sfd < 0) {
|
||||
close(lfd);
|
||||
@ -644,7 +644,7 @@ static int pipe_ssloverssl(struct connectdata *conn, int sockindex,
|
||||
/* Try getting data from HTTPS proxy and pipe it upstream. */
|
||||
n = 0;
|
||||
i = gsk_secure_soc_read(connproxyssl->backend->handle,
|
||||
buf, sizeof buf, &n);
|
||||
buf, sizeof(buf), &n);
|
||||
switch(i) {
|
||||
case GSK_OK:
|
||||
if(n) {
|
||||
@ -665,7 +665,7 @@ static int pipe_ssloverssl(struct connectdata *conn, int sockindex,
|
||||
if(FD_ISSET(BACKEND->remotefd, &fds_read) &&
|
||||
FD_ISSET(conn->sock[sockindex], &fds_write)) {
|
||||
/* Pipe data to HTTPS proxy. */
|
||||
n = read(BACKEND->remotefd, buf, sizeof buf);
|
||||
n = read(BACKEND->remotefd, buf, sizeof(buf));
|
||||
if(n < 0)
|
||||
return -1;
|
||||
if(n) {
|
||||
@ -864,13 +864,13 @@ static CURLcode gskit_connect_step1(struct connectdata *conn, int sockindex)
|
||||
BACKEND->localfd = sockpair[0];
|
||||
BACKEND->remotefd = sockpair[1];
|
||||
setsockopt(BACKEND->localfd, SOL_SOCKET, SO_RCVBUF,
|
||||
(void *) sobufsize, sizeof sobufsize);
|
||||
(void *) sobufsize, sizeof(sobufsize));
|
||||
setsockopt(BACKEND->remotefd, SOL_SOCKET, SO_RCVBUF,
|
||||
(void *) sobufsize, sizeof sobufsize);
|
||||
(void *) sobufsize, sizeof(sobufsize));
|
||||
setsockopt(BACKEND->localfd, SOL_SOCKET, SO_SNDBUF,
|
||||
(void *) sobufsize, sizeof sobufsize);
|
||||
(void *) sobufsize, sizeof(sobufsize));
|
||||
setsockopt(BACKEND->remotefd, SOL_SOCKET, SO_SNDBUF,
|
||||
(void *) sobufsize, sizeof sobufsize);
|
||||
(void *) sobufsize, sizeof(sobufsize));
|
||||
curlx_nonblock(BACKEND->localfd, TRUE);
|
||||
curlx_nonblock(BACKEND->remotefd, TRUE);
|
||||
}
|
||||
@ -977,7 +977,7 @@ static CURLcode gskit_connect_step1(struct connectdata *conn, int sockindex)
|
||||
|
||||
if(!result) {
|
||||
/* Start handshake. Try asynchronous first. */
|
||||
memset(&commarea, 0, sizeof commarea);
|
||||
memset(&commarea, 0, sizeof(commarea));
|
||||
BACKEND->iocport = QsoCreateIOCompletionPort();
|
||||
if(BACKEND->iocport != -1) {
|
||||
result = gskit_status(data,
|
||||
@ -1333,11 +1333,11 @@ static int Curl_gskit_check_cxn(struct connectdata *cxn)
|
||||
return 0; /* connection has been closed */
|
||||
|
||||
err = 0;
|
||||
errlen = sizeof err;
|
||||
errlen = sizeof(err);
|
||||
|
||||
if(getsockopt(cxn->sock[FIRSTSOCKET], SOL_SOCKET, SO_ERROR,
|
||||
(unsigned char *) &err, &errlen) ||
|
||||
errlen != sizeof err || err)
|
||||
errlen != sizeof(err) || err)
|
||||
return 0; /* connection has been closed */
|
||||
|
||||
return -1; /* connection status unknown */
|
||||
|
@ -394,7 +394,7 @@ static PK11SlotInfo* nss_find_slot_by_name(const char *slot_name)
|
||||
/* wrap 'ptr' as list node and tail-insert into 'list' */
|
||||
static CURLcode insert_wrapped_ptr(struct curl_llist *list, void *ptr)
|
||||
{
|
||||
struct ptr_list_wrap *wrap = malloc(sizeof *wrap);
|
||||
struct ptr_list_wrap *wrap = malloc(sizeof(*wrap));
|
||||
if(!wrap)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
@ -914,11 +914,11 @@ static CURLcode display_conn_info(struct connectdata *conn, PRFileDesc *sock)
|
||||
PRTime now;
|
||||
int i;
|
||||
|
||||
if(SSL_GetChannelInfo(sock, &channel, sizeof channel) ==
|
||||
SECSuccess && channel.length == sizeof channel &&
|
||||
if(SSL_GetChannelInfo(sock, &channel, sizeof(channel)) ==
|
||||
SECSuccess && channel.length == sizeof(channel) &&
|
||||
channel.cipherSuite) {
|
||||
if(SSL_GetCipherSuiteInfo(channel.cipherSuite,
|
||||
&suite, sizeof suite) == SECSuccess) {
|
||||
&suite, sizeof(suite)) == SECSuccess) {
|
||||
infof(conn->data, "SSL connection using %s\n", suite.cipherSuiteName);
|
||||
}
|
||||
}
|
||||
@ -1345,7 +1345,8 @@ static CURLcode nss_init(struct Curl_easy *data)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
/* the default methods just call down to the lower I/O layer */
|
||||
memcpy(&nspr_io_methods, PR_GetDefaultIOMethods(), sizeof nspr_io_methods);
|
||||
memcpy(&nspr_io_methods, PR_GetDefaultIOMethods(),
|
||||
sizeof(nspr_io_methods));
|
||||
|
||||
/* override certain methods in the table by our wrappers */
|
||||
nspr_io_methods.recv = nspr_io_recv;
|
||||
|
@ -1849,7 +1849,7 @@ static CURLcode pkp_pin_peer_pubkey(struct connectdata *conn, int sockindex,
|
||||
|
||||
x509_der = (const char *)pCertContextServer->pbCertEncoded;
|
||||
x509_der_len = pCertContextServer->cbCertEncoded;
|
||||
memset(&x509_parsed, 0, sizeof x509_parsed);
|
||||
memset(&x509_parsed, 0, sizeof(x509_parsed));
|
||||
if(Curl_parseX509(&x509_parsed, x509_der, x509_der + x509_der_len))
|
||||
break;
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2018, 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
|
||||
@ -712,7 +712,7 @@ int Curl_parseX509(curl_X509certificate *cert,
|
||||
/* Get optional version, get serialNumber. */
|
||||
cert->version.header = NULL;
|
||||
cert->version.beg = &defaultVersion;
|
||||
cert->version.end = &defaultVersion + sizeof defaultVersion;;
|
||||
cert->version.end = &defaultVersion + sizeof(defaultVersion);
|
||||
beg = Curl_getASN1Element(&elem, beg, end);
|
||||
if(elem.tag == 0) {
|
||||
Curl_getASN1Element(&cert->version, elem.beg, elem.end);
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2018, 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
|
||||
@ -168,12 +168,12 @@ static int read_field_headers(struct OperationConfig *config,
|
||||
|
||||
pos++;
|
||||
if(!incomment) {
|
||||
if(hdrlen == sizeof hdrbuf - 1) {
|
||||
if(hdrlen == sizeof(hdrbuf) - 1) {
|
||||
warnf(config->global, "File %s line %d: header too long (truncated)\n",
|
||||
filename, lineno);
|
||||
c = ' ';
|
||||
}
|
||||
if(hdrlen <= sizeof hdrbuf - 1)
|
||||
if(hdrlen <= sizeof(hdrbuf) - 1)
|
||||
hdrbuf[hdrlen++] = (char) c;
|
||||
}
|
||||
}
|
||||
@ -451,7 +451,7 @@ static CURLcode file_or_stdin(curl_mimepart *part, const char *file)
|
||||
if(strcmp(file, "-"))
|
||||
return curl_mime_filedata(part, file);
|
||||
|
||||
sip = (standard_input *) calloc(1, sizeof *sip);
|
||||
sip = (standard_input *) calloc(1, sizeof(*sip));
|
||||
if(!sip)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
|
@ -246,7 +246,7 @@ static int nss_hash_init(void **pctx, SECOidTag hash_alg)
|
||||
/* we have to initialize NSS if not initialized already */
|
||||
if(!NSS_IsInitialized() && !nss_context) {
|
||||
static NSSInitParameters params;
|
||||
params.length = sizeof params;
|
||||
params.length = sizeof(params);
|
||||
nss_context = NSS_InitContext("", "", "", "", ¶ms, NSS_INIT_READONLY
|
||||
| NSS_INIT_NOCERTDB | NSS_INIT_NOMODDB | NSS_INIT_FORCEOPEN
|
||||
| NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE | NSS_INIT_PK11RELOAD);
|
||||
@ -529,7 +529,7 @@ digest_context *Curl_digest_init(const digest_params *dparams)
|
||||
digest_context *ctxt;
|
||||
|
||||
/* Create digest context */
|
||||
ctxt = malloc(sizeof *ctxt);
|
||||
ctxt = malloc(sizeof(*ctxt));
|
||||
|
||||
if(!ctxt)
|
||||
return ctxt;
|
||||
|
@ -61,7 +61,7 @@ int test(char *URL)
|
||||
test_setopt(curl, CURLOPT_URL, URL);
|
||||
|
||||
#ifdef LIB545
|
||||
test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof teststring);
|
||||
test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof(teststring));
|
||||
#endif
|
||||
|
||||
test_setopt(curl, CURLOPT_COPYPOSTFIELDS, teststring);
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2018, 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
|
||||
@ -185,7 +185,7 @@ int test(char *URL)
|
||||
|
||||
/* setup repeated data string */
|
||||
for(i = 0; i < sizeof(databuf); ++i)
|
||||
databuf[i] = fill[i % sizeof fill];
|
||||
databuf[i] = fill[i % sizeof(fill)];
|
||||
|
||||
/* Post */
|
||||
test_setopt(curl, CURLOPT_POST, 1L);
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2018, 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
|
||||
@ -153,7 +153,7 @@ int test(char *URL)
|
||||
curl_formget(formpost, (void *) &formlength, count_chars);
|
||||
|
||||
/* Include length in data for external check. */
|
||||
curl_msnprintf(flbuf, sizeof flbuf, "%lu", (unsigned long) formlength);
|
||||
curl_msnprintf(flbuf, sizeof(flbuf), "%lu", (unsigned long) formlength);
|
||||
formrc = curl_formadd(&formpost,
|
||||
&lastptr,
|
||||
CURLFORM_COPYNAME, "formlength",
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2018, 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
|
||||
@ -75,7 +75,7 @@ int test(char *URL)
|
||||
fprintf(stderr, "curl_mime_type() failed\n");
|
||||
goto test_cleanup;
|
||||
}
|
||||
res = curl_mime_data(part, buffer, sizeof buffer);
|
||||
res = curl_mime_data(part, buffer, sizeof(buffer));
|
||||
if(res) {
|
||||
fprintf(stderr, "curl_mime_data() failed\n");
|
||||
goto test_cleanup;
|
||||
|
@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2018, 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
|
||||
@ -295,7 +295,7 @@ UNITTEST_START
|
||||
|
||||
size_t i;
|
||||
|
||||
for(i = 0; i < sizeof data / sizeof data[0]; ++i) {
|
||||
for(i = 0; i < sizeof(data) / sizeof(data[0]); ++i) {
|
||||
char *output = NULL;
|
||||
char *flagstr = NULL;
|
||||
char *received_ccstr = NULL;
|
||||
|
@ -120,7 +120,7 @@ UNITTEST_START
|
||||
|
||||
for(i = 0; i < testnum; ++i, curl_easy_reset(easy)) {
|
||||
int j;
|
||||
int addressnum = sizeof tests[i].address / sizeof *tests[i].address;
|
||||
int addressnum = sizeof(tests[i].address) / sizeof(*tests[i].address);
|
||||
struct Curl_addrinfo *addr;
|
||||
struct Curl_dns_entry *dns;
|
||||
struct curl_slist *list;
|
||||
|
Loading…
Reference in New Issue
Block a user