summaryrefslogtreecommitdiffstats
path: root/zebra/client_main.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-04-16 20:28:16 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-04-17 19:58:24 +0200
commit6c2232947968f34b4038ce027861b3a0b8fb030f (patch)
tree788074753e305a51f9bc6e07b0fb9c08e07ad216 /zebra/client_main.c
parentMerge pull request #2058 from chipitsine/master (diff)
downloadfrr-6c2232947968f34b4038ce027861b3a0b8fb030f.tar.xz
frr-6c2232947968f34b4038ce027861b3a0b8fb030f.zip
zebra: fix error-prone array iterator
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra/client_main.c')
-rw-r--r--zebra/client_main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/zebra/client_main.c b/zebra/client_main.c
index 4035e53f7..1ead7ee1f 100644
--- a/zebra/client_main.c
+++ b/zebra/client_main.c
@@ -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;