mirror of
https://github.com/curl/curl.git
synced 2026-08-25 04:43:33 +03:00
tidy-up: use CURL_ARRAYSIZE()
Follow-up to 13b2ea68f0 #16111
Closes #16381
This commit is contained in:
parent
1b710381ca
commit
3fd1dfc829
35 changed files with 52 additions and 64 deletions
|
|
@ -169,7 +169,7 @@ int main(int argc, char **argv)
|
|||
test_func = NULL;
|
||||
{
|
||||
size_t tmp;
|
||||
for(tmp = 0; tmp < (sizeof(s_tests)/sizeof((s_tests)[0])); ++tmp) {
|
||||
for(tmp = 0; tmp < CURL_ARRAYSIZE(s_tests); ++tmp) {
|
||||
if(strcmp(test_name, s_tests[tmp].name) == 0) {
|
||||
test_func = s_tests[tmp].ptr;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ CURLcode test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
for(i = 0; i < sizeof(testparams) / sizeof(testparams[0]); i++) {
|
||||
for(i = 0; i < CURL_ARRAYSIZE(testparams); i++) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
/* The size of data should be kept below MAX_INITIAL_POST_SIZE! */
|
||||
static char testdata[]="this is a short string.\n";
|
||||
|
||||
static size_t data_size = sizeof(testdata) / sizeof(char);
|
||||
static size_t data_size = CURL_ARRAYSIZE(testdata);
|
||||
|
||||
static int progress_callback(void *clientp, double dltotal, double dlnow,
|
||||
double ultotal, double ulnow)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue