Fixed compiler warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args] (#1133)

* Fixed compiler  warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]

* Fixed compile error found in pipeline build.

* Fixed pre-commit
This commit is contained in:
Steve Karg
2025-11-09 13:26:35 -06:00
committed by GitHub
parent c6076f2561
commit 28a30be5ec
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -148,7 +148,7 @@ static void test_BACnetDestination_ASCII(void)
/* get the length */
null_len = bacnet_destination_to_ascii(&test_destination, NULL, 0);
if (null_len > 0) {
test_ascii = calloc(null_len, 1);
test_ascii = calloc(null_len, sizeof(char));
if (test_ascii) {
test_len = bacnet_destination_to_ascii(
&test_destination, test_ascii, null_len);
+1 -1
View File
@@ -5,7 +5,7 @@
* @date May 2022
* @copyright SPDX-License-Identifier: MIT
*/
#include <stdlib.h> /* For calloc() */
#include <stdlib.h>
#include <zephyr/ztest.h>
#include <bacnet/datalink/bsc/bvlc-sc.h>
+1 -1
View File
@@ -6,7 +6,7 @@
* @date 2020
* @copyright SPDX-License-Identifier: MIT
*/
#include <stdlib.h> /* For calloc() */
#include <stdlib.h>
#include <zephyr/ztest.h>
#include <bacnet/datalink/datalink.h>
#include "bacnet/apdu.h"