tidy-up: use CURL_ARRAYSIZE()

Follow-up to 13b2ea68f0 #16111

Closes #16381
This commit is contained in:
Viktor Szakats 2025-02-18 14:48:18 +01:00
parent 1b710381ca
commit 3fd1dfc829
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
35 changed files with 52 additions and 64 deletions

View file

@ -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;

View file

@ -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");

View file

@ -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)