Fix syntax of calloc calls in pinelog.c

`calloc` requires the count to be the first argument, and the size
parameter to be the second argument. However, this has not really caused
issues in the past, and older compilers were not so strict about it.

However, newer compilers (at least GCC 14) triggers a warning on this
and causes the build to fail.

Fixes #52
fix-macos-14-builds
nirenjan 2024-06-04 15:02:27 -07:00
parent 9e2e8cb8ff
commit 21050e40a8
1 changed files with 2 additions and 2 deletions

View File

@ -120,13 +120,13 @@ int pinelog_init(int count) {
free(module_level);
free(module_name);
module_level = calloc(sizeof(*module_level), count);
module_level = calloc(count, sizeof(*module_level));
if (module_level == NULL) {
rc = errno;
goto cleanup;
}
module_name = calloc(sizeof(*module_name), count);
module_name = calloc(count, sizeof(*module_name));
if (module_name == NULL) {
rc = errno;
goto cleanup;