From 41becc0a9a3008b37d94c26b16fd853c9d4a73a7 Mon Sep 17 00:00:00 2001 From: skarg Date: Thu, 16 Aug 2012 18:56:17 +0000 Subject: [PATCH] CPPCheck found fixes. --- bacnet-stack/demo/epics/main.c | 2 +- bacnet-stack/demo/gateway/main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bacnet-stack/demo/epics/main.c b/bacnet-stack/demo/epics/main.c index e628e1e0..8d777a38 100644 --- a/bacnet-stack/demo/epics/main.c +++ b/bacnet-stack/demo/epics/main.c @@ -998,7 +998,7 @@ int CheckCommandLineArgs( /* loop counter */ unsigned j; count = - sscanf(argv[i], "%x:%x:%x:%x:%x:%x", &mac[0], + sscanf(argv[i], "%2x:%2x:%2x:%2x:%2x:%2x", &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5]); if (count == 6) { /* success */ Target_Address.mac_len = count; diff --git a/bacnet-stack/demo/gateway/main.c b/bacnet-stack/demo/gateway/main.c index 816b5814..25cf8e06 100644 --- a/bacnet-stack/demo/gateway/main.c +++ b/bacnet-stack/demo/gateway/main.c @@ -180,10 +180,10 @@ void Initialize_Device_Addresses( ) { int i = 0; /* First entry is Gateway Device */ - DEVICE_OBJECT_DATA *pDev; - uint16_t myPort; + DEVICE_OBJECT_DATA *pDev = NULL; /* Setup info for the main gateway device first */ #if defined(BACDL_BIP) + uint16_t myPort; struct in_addr *netPtr; /* Lets us cast to this type */ uint8_t *gatewayMac = NULL; uint32_t myAddr = bip_get_addr();