Bugfix/fix splint warnings (#250)

* Fix SPLINT to perform static defect analysis

Fix the SPLINT invocation in Makefile
Fix C files where SPLINT detected problems.
Remove UCIX check from SPLINT
Use SPLINT friendly parsing code disable for bacsec

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2022-04-12 13:00:29 -05:00
committed by GitHub
parent f6fad83f61
commit c9d42d268e
13 changed files with 268 additions and 256 deletions
+3 -2
View File
@@ -181,18 +181,19 @@ static bool bbmd6_add_vmac(uint32_t device_id, BACNET_IP6_ADDRESS *addr)
bool status = false;
struct vmac_data *vmac;
struct vmac_data new_vmac;
unsigned i = 0;
if (addr) {
vmac = VMAC_Find_By_Key(device_id);
if (vmac) {
/* already exists - replace? */
PRINTF("VMAC existing %u [", (unsigned int)device_id);
for (unsigned i = 0; i < vmac->mac_len; i++) {
for (i = 0; i < vmac->mac_len; i++) {
PRINTF("%02X", vmac->mac[i]);
}
PRINTF("]\n");
PRINTF("VMAC ignoring %u [", (unsigned int)device_id);
for (unsigned i = 0; i < IP6_ADDRESS_MAX; i++) {
for (i = 0; i < IP6_ADDRESS_MAX; i++) {
PRINTF("%02X", addr->address[i]);
}
PRINTF("%04X", addr->port);
+2 -1
View File
@@ -258,6 +258,7 @@ void VMAC_Cleanup(void)
struct vmac_data *pVMAC;
uint32_t device_id;
const int index = 0;
unsigned i = 0;
if (VMAC_List) {
do {
@@ -266,7 +267,7 @@ void VMAC_Cleanup(void)
if (pVMAC) {
PRINTF("VMAC List: %lu [", (unsigned long)device_id);
/* print the MAC */
for (unsigned i = 0; i < pVMAC->mac_len; i++) {
for (i = 0; i < pVMAC->mac_len; i++) {
PRINTF("%02X", pVMAC->mac[i]);
}
PRINTF("]\n");