]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: fix error-prone array iterator
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 16 Apr 2018 18:28:16 +0000 (14:28 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 17 Apr 2018 17:58:24 +0000 (13:58 -0400)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
zebra/client_main.c

index 4035e53f7ce89c72c2902c21b093e8a55c307ce7..1ead7ee1fd377ca77cd0b805d6032d0ba95449bc 100644 (file)
@@ -148,9 +148,8 @@ void zebra_sim(FILE *fp)
                                continue;
                }
 
-               for (i = 0; i < 10; i++) {
-                       if (!zebra_type[i].str)
-                               break;
+               i = 0;
+               while (zebra_type[i++].str) {
                        if (strcmp(zebra_type[i].str, str) == 0) {
                                type = zebra_type[i].type;
                                break;