mirror of https://github.com/nirenjan/libx52.git
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 #52fix-macos-14-builds
parent
9e2e8cb8ff
commit
21050e40a8
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue