summaryrefslogtreecommitdiff
path: root/tests/lib
diff options
context:
space:
mode:
authorAriel Otilibili <ariel.otilibili@6wind.com>2025-01-06 15:45:30 +0100
committerAriel Otilibili <ariel.otilibili@6wind.com>2025-01-06 15:47:55 +0100
commit84d0ab9896f090ea21c9e3396c837058d50dd9ed (patch)
treee4729dfbc125aa268aa79f0025edf33d69463e26 /tests/lib
parent8ca4c3d0988c169ed41557727f45b69c8ce3aa0b (diff)
tests: clear -Wcalloc-transposed-args warnings
* order of arguments was swapped; not consistent with calloc signature * therefore producing -Wcalloc-transposed-args during compilation. Link: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html Link: https://man7.org/linux/man-pages/man3/calloc.3p.html Signed-off-by: Ariel Otilibili <ariel.otilibili@6wind.com>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/test_nexthop_iter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/lib/test_nexthop_iter.c b/tests/lib/test_nexthop_iter.c
index 33ff116890..b70ef5606c 100644
--- a/tests/lib/test_nexthop_iter.c
+++ b/tests/lib/test_nexthop_iter.c
@@ -62,7 +62,7 @@ static struct nexthop_chain *nexthop_chain_new(void)
{
struct nexthop_chain *rv;
- rv = calloc(sizeof(*rv), 1);
+ rv = calloc(1, sizeof(*rv));
assert(rv);
return rv;
}
@@ -71,7 +71,7 @@ static void nexthop_chain_add_top(struct nexthop_chain *nc)
{
struct nexthop *nh;
- nh = calloc(sizeof(*nh), 1);
+ nh = calloc(1, sizeof(*nh));
assert(nh);
if (nc->head.nexthop) {
@@ -109,7 +109,7 @@ static void nexthop_chain_add_recursive(struct nexthop_chain *nc)
{
struct nexthop *nh;
- nh = calloc(sizeof(*nh), 1);
+ nh = calloc(1, sizeof(*nh));
assert(nh);
assert(nc->current_top);
@@ -128,7 +128,7 @@ static void nexthop_chain_add_recursive_level(struct nexthop_chain *nc)
{
struct nexthop *nh;
- nh = calloc(sizeof(*nh), 1);
+ nh = calloc(1, sizeof(*nh));
assert(nh);
assert(nc->current_top);