From a5144b9db2c8c77fbe7fa8e15e7d9e28920099d5 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sun, 9 Jun 2024 22:59:04 -0400 Subject: Break loop when expected lines are exhausted --- tests/test_strlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_strlist.c') diff --git a/tests/test_strlist.c b/tests/test_strlist.c index 9041fd4..bdc0641 100644 --- a/tests/test_strlist.c +++ b/tests/test_strlist.c @@ -136,7 +136,7 @@ void test_strlist_append_file() { return; } strlist_append_file(list, (char *) tc[i].origin, NULL); - for (size_t z = 0; z < strlist_count(list); z++) { + for (size_t z = 0; z < strlist_count(list) && expected[z] != NULL; z++) { const char *left; const char *right; left = strlist_item(list, z); -- cgit