From: Tobias Brunner Date: Fri, 12 Jul 2024 12:00:15 +0000 (+0200) Subject: daemon: Use correct argument order for calloc() to fix compiler warning X-Git-Tag: android-2.5.2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6eec5cc07da78b058e2236753928767f3e60c3e9;p=thirdparty%2Fstrongswan.git 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 --- 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++) {