From: Christian Franke <[email protected]>

The loop should only iterate to array_size - 1.

Signed-off-by: Christian Franke <[email protected]>
---
 ospf6d/ospf6_spf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index 6d2e536..c3431c3 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -402,7 +402,7 @@ void ospf6_spf_reason_string (unsigned int reason, char 
*buf, int size)
   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))
        {
-- 
2.8.0


_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to