diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-06-09 22:59:04 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-06-09 22:59:04 -0400 |
commit | a5144b9db2c8c77fbe7fa8e15e7d9e28920099d5 (patch) | |
tree | 840b50a03f4b894bf94e7f8588b9c8dfe148421b | |
parent | c44d563ea5bd5e1fc3c5bebb4aaaa14ff08ecfde (diff) | |
download | stasis-a5144b9db2c8c77fbe7fa8e15e7d9e28920099d5.tar.gz |
Break loop when expected lines are exhausted
-rw-r--r-- | tests/test_strlist.c | 2 |
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); |