ospf6d: fix off-by-one on display of spf reasons
The loop should only iterate to array_size - 1.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index ebb38b6..b6dbd0d 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -403,7 +403,7 @@
if (!buf)
return;
- for (bit = 0; bit <= (sizeof(ospf6_spf_reason_str) / sizeof(char *)); bit++)
+ for (bit = 0; bit < array_size(ospf6_spf_reason_str); bit++)
{
if ((reason & (1 << bit)) && (len < size))
{