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>
This commit is contained in:
Christian Franke 2016-06-14 20:07:04 +02:00 committed by Donald Sharp
parent c8cdf5c774
commit e531bbe2f0

View File

@ -444,7 +444,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))
{