diff options
author | Corubba Smith <corubba@gmx.de> | 2025-03-08 22:27:56 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2025-03-09 12:19:12 +0100 |
commit | cee44b4bb0d45868807440317376032f1f186ede (patch) | |
tree | 3bff42ea2180dafdbfe83f543b6a55b16709eb4e | |
parent | 244a2e259d1e80a34cc55e36856b3de5b885395d (diff) |
nfct: fix calloc argument order
The first argument to calloc() is the number of elements, the second is
the size of a single element. Having the arguments switched shouldn't
make any difference during runtime, but GCC warns about it when using
-Wcalloc-transposed-args [0].
[0] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wcalloc-transposed-args
Signed-off-by: Corubba Smith <corubba@gmx.de>
Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r-- | input/flow/ulogd_inpflow_NFCT.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/input/flow/ulogd_inpflow_NFCT.c b/input/flow/ulogd_inpflow_NFCT.c index 899b7e3..5ac24e5 100644 --- a/input/flow/ulogd_inpflow_NFCT.c +++ b/input/flow/ulogd_inpflow_NFCT.c @@ -660,7 +660,7 @@ event_handler_hashtable(enum nf_conntrack_msg_type type, switch(type) { case NFCT_T_NEW: - ts = calloc(sizeof(struct ct_timestamp), 1); + ts = calloc(1, sizeof(struct ct_timestamp)); if (ts == NULL) return NFCT_CB_CONTINUE; @@ -681,7 +681,7 @@ event_handler_hashtable(enum nf_conntrack_msg_type type, if (ts) nfct_copy(ts->ct, ct, NFCT_CP_META); else { - ts = calloc(sizeof(struct ct_timestamp), 1); + ts = calloc(1, sizeof(struct ct_timestamp)); if (ts == NULL) return NFCT_CB_CONTINUE; @@ -771,7 +771,7 @@ polling_handler(enum nf_conntrack_msg_type type, if (ts) nfct_copy(ts->ct, ct, NFCT_CP_META); else { - ts = calloc(sizeof(struct ct_timestamp), 1); + ts = calloc(1, sizeof(struct ct_timestamp)); if (ts == NULL) return NFCT_CB_CONTINUE; @@ -908,7 +908,7 @@ static int overrun_handler(enum nf_conntrack_msg_type type, ts = (struct ct_timestamp *) hashtable_find(cpi->ct_active, ct, id); if (ts == NULL) { - ts = calloc(sizeof(struct ct_timestamp), 1); + ts = calloc(1, sizeof(struct ct_timestamp)); if (ts == NULL) return NFCT_CB_CONTINUE; @@ -971,7 +971,7 @@ dump_reset_handler(enum nf_conntrack_msg_type type, if (ts) nfct_copy(ts->ct, ct, NFCT_CP_META); else { - ts = calloc(sizeof(struct ct_timestamp), 1); + ts = calloc(1, sizeof(struct ct_timestamp)); if (ts == NULL) return NFCT_CB_CONTINUE; |