From 6eec5cc07da78b058e2236753928767f3e60c3e9 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 12 Jul 2024 14:00:15 +0200 Subject: [PATCH] daemon: Use correct argument order for calloc() to fix compiler warning The number of elements is the first argument, their size the second. The previous code triggered the following warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument --- src/libcharon/daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcharon/daemon.c b/src/libcharon/daemon.c index fca6648014..c48fa0a6f0 100644 --- a/src/libcharon/daemon.c +++ b/src/libcharon/daemon.c @@ -652,7 +652,7 @@ METHOD(daemon_t, set_default_loggers, void, { if (!this->levels) { - this->levels = calloc(sizeof(level_t), DBG_MAX); + this->levels = calloc(DBG_MAX, sizeof(level_t)); } for (group = 0; group < DBG_MAX; group++) {