[Olsr-dev] [PATCH v1 13/14] quagga: fix GCC 6 warnings

Ferry Huberts (spam-protected)
Wed Feb 24 00:46:22 CET 2016


From: Ferry Huberts <(spam-protected)>

src/plugin.c:57:66: error: logical ‘and’ of equal expressions [-Werror=logical-op]
   for (i = 0; i < ARRAYSIZE(zroute_types) && i < ZEBRA_ROUTE_MAX; i++) {
                                                                  ^~

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 lib/quagga/src/plugin.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/quagga/src/plugin.c b/lib/quagga/src/plugin.c
index 5444245..2e9c2f9 100644
--- a/lib/quagga/src/plugin.c
+++ b/lib/quagga/src/plugin.c
@@ -54,7 +54,8 @@ zplugin_redistribute(const char *value, void *data __attribute__ ((unused)), set
   };
   unsigned int i;
 
-  for (i = 0; i < ARRAYSIZE(zroute_types) && i < ZEBRA_ROUTE_MAX; i++) {
+  unsigned int max = MIN(ARRAYSIZE(zroute_types), ZEBRA_ROUTE_MAX);
+  for (i = 0; i < max; i++) {
     if (!strcmp(value, zroute_types[i]))
       zebra.redistribute[i] = 1;
   }
-- 
2.5.0




More information about the Olsr-dev mailing list