ripd, isisd: fix warnings that make the build fail
These issues have been found by running buildtest.sh
using GCC 5.2.0 and Clang 3.7.0
Fixes pointer checks that can never be null
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Tested-by: NetDEF CI System <cisystem@netdef.org>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c
index a485575..b8d28b3 100644
--- a/isisd/isis_adjacency.c
+++ b/isisd/isis_adjacency.c
@@ -203,7 +203,7 @@
if (dyn)
adj_name = (const char *)dyn->name.name;
else
- adj_name = adj->sysid ? sysid_print (adj->sysid) : "unknown";
+ adj_name = sysid_print (adj->sysid);
zlog_info ("%%ADJCHANGE: Adjacency to %s (%s) changed from %s to %s, %s",
adj_name,
@@ -314,8 +314,8 @@
zlog_debug ("%s", dyn->name.name);
zlog_debug ("SystemId %20s SNPA %s, level %d\nHolding Time %d",
- adj->sysid ? sysid_print (adj->sysid) : "unknown",
- snpa_print (adj->snpa), adj->level, adj->hold_time);
+ sysid_print (adj->sysid), snpa_print (adj->snpa),
+ adj->level, adj->hold_time);
if (adj->ipv4_addrs && listcount (adj->ipv4_addrs) > 0)
{
zlog_debug ("IPv4 Address(es):");
diff --git a/ripd/ripd.c b/ripd/ripd.c
index b708889..870873d 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -2574,7 +2574,7 @@
if (IS_RIP_DEBUG_EVENT)
zlog_debug("SEND UPDATE to %s ifindex %d",
- (ifp->name ? ifp->name : "_unknown_"), ifp->ifindex);
+ ifp->name, ifp->ifindex);
/* send update on each connected network */
for (ALL_LIST_ELEMENTS (ifp->connected, ifnode, ifnnode, connected))