aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-06-09 22:59:04 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-06-09 22:59:04 -0400
commita5144b9db2c8c77fbe7fa8e15e7d9e28920099d5 (patch)
tree840b50a03f4b894bf94e7f8588b9c8dfe148421b
parentc44d563ea5bd5e1fc3c5bebb4aaaa14ff08ecfde (diff)
downloadstasis-a5144b9db2c8c77fbe7fa8e15e7d9e28920099d5.tar.gz
Break loop when expected lines are exhausted
-rw-r--r--tests/test_strlist.c2
1 files changed, 1 insertions, 1 deletions
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);