summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2024-05-06 08:00:14 (GMT)
committerThomas Haller <thaller@redhat.com>2024-05-06 08:00:28 (GMT)
commitdb1a9d7d02710b46e51c559a52eb8a5174926670 (patch)
tree342552e1e92dbc8e6f63fadf3e5208cf24415be1
parent3a43faa1aa8e9fb98ae8bc41496ceabc4c0838f1 (diff)
downloadlibnl-db1a9d7d02710b46e51c559a52eb8a5174926670.zip
libnl-db1a9d7d02710b46e51c559a52eb8a5174926670.tar.gz
libnl-db1a9d7d02710b46e51c559a52eb8a5174926670.tar.bz2
route: avoid compiler warning about calloc() arguments in rtnl_netem_set_delay_distribution()
CC lib/route/qdisc/libnl_route_3_la-netem.lo lib/route/qdisc/netem.c: In function 'rtnl_netem_set_delay_distribution': lib/route/qdisc/netem.c:975:39: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 975 | line = (char *) calloc(sizeof(char), len + 1); | ^~~~ lib/route/qdisc/netem.c:975:39: note: earlier argument should specify number of elements, later size of each element
-rw-r--r--lib/route/qdisc/netem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/route/qdisc/netem.c b/lib/route/qdisc/netem.c
index 6dde4f0..8ced034 100644
--- a/lib/route/qdisc/netem.c
+++ b/lib/route/qdisc/netem.c
@@ -972,7 +972,7 @@ int rtnl_netem_set_delay_distribution(struct rtnl_qdisc *qdisc, const char *dist
return -nl_syserr2nlerr(errno);
data = (int16_t *) calloc(MAXDIST, sizeof(int16_t));
- line = (char *) calloc(sizeof(char), len + 1);
+ line = (char *) calloc(len + 1, sizeof(char));
if (!data || !line) {
fclose(f);
return -NLE_NOMEM;