From ca617d679ff296a4abe0e7526d8e8cab4f87e338 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 15 Jul 2009 07:50:34 +0000 Subject: Having to update NSETOPTION/NSETWINDOWOPTION when adding new options is a bit annoying and it is only use for iterating, so use a sentinel to mark the end of each array instead. Different fix for a problem pointed out by Kalle Olavi Niemitalo. --- cmd-show-options.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'cmd-show-options.c') diff --git a/cmd-show-options.c b/cmd-show-options.c index e5f50859..dab08917 100644 --- a/cmd-show-options.c +++ b/cmd-show-options.c @@ -49,7 +49,6 @@ cmd_show_options_exec(struct cmd *self, struct cmd_ctx *ctx) struct session *s; struct options *oo; const struct set_option_entry *entry; - u_int i; char *vs; long long vn; @@ -61,9 +60,7 @@ cmd_show_options_exec(struct cmd *self, struct cmd_ctx *ctx) oo = &s->options; } - for (i = 0; i < NSETOPTION; i++) { - entry = &set_option_table[i]; - + for (entry = set_option_table; entry->name != NULL; entry++) { if (options_find1(oo, entry->name) == NULL) continue; -- cgit v1.2.3