mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-03-24 20:40:09 +09:00
Use ARRAY_SIZE systematically
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Eshan Kelkar <eshankelkar@galorithm.com>
This commit is contained in:
@@ -167,7 +167,7 @@ static void torture_connect_addrfamily(void **state)
|
||||
{SSH_ADDRESS_FAMILY_INET6, "afinet6", SSH_OK},
|
||||
};
|
||||
|
||||
int aftest_count = sizeof(aftests) / sizeof(aftests[0]);
|
||||
int aftest_count = ARRAY_SIZE(aftests);
|
||||
for (int i = 0; i < aftest_count; ++i) {
|
||||
struct aftest const *t = &aftests[i];
|
||||
|
||||
|
||||
@@ -94,8 +94,7 @@ static void torture_kex_basic_functionality(void **state)
|
||||
assert_non_null(kex_algo);
|
||||
|
||||
is_valid_algo = false;
|
||||
valid_algorithms_count =
|
||||
sizeof(valid_algorithms) / sizeof(valid_algorithms[0]);
|
||||
valid_algorithms_count = ARRAY_SIZE(valid_algorithms);
|
||||
for (i = 0; i < valid_algorithms_count; i++) {
|
||||
if (strcmp(kex_algo, valid_algorithms[i]) == 0) {
|
||||
is_valid_algo = true;
|
||||
|
||||
Reference in New Issue
Block a user