summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2024-08-22 11:17:17 (GMT)
committerThomas Haller <thaller@redhat.com>2024-08-22 11:32:38 (GMT)
commit798278eabc5111588df8024a22df2644ca26ab31 (patch)
tree4dc256b6a761062db10fff45eb1a0b27913f937f
parentdef89a2c0e731dc4dd77e18d26baa61510276580 (diff)
downloadlibnl-798278eabc5111588df8024a22df2644ca26ab31.zip
libnl-798278eabc5111588df8024a22df2644ca26ab31.tar.gz
libnl-798278eabc5111588df8024a22df2644ca26ab31.tar.bz2
tests: use _nl_ptrarray_len() helper in _nltst_assert_route_list()
-rw-r--r--tests/nl-test-util.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/tests/nl-test-util.c b/tests/nl-test-util.c
index 6bbe2ae..1503907 100644
--- a/tests/nl-test-util.c
+++ b/tests/nl-test-util.c
@@ -1000,14 +1000,7 @@ void _nltst_assert_route_list(struct nl_object *const *objs, ssize_t len,
size_t l;
size_t i;
- if (len < 0) {
- l = 0;
- if (objs) {
- while (objs[l])
- l++;
- }
- } else
- l = len;
+ l = _nl_ptrarray_len(objs, len);
for (i = 0; i < l; i++) {
struct nl_object *route = objs[i];