mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:03:36 +03: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
25 changed files with 77 additions and 64 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue