diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-07-15 17:44:47 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-07-15 17:44:47 +0000 |
commit | ff90170738dad3ab6d302790672c57a3e10e9075 (patch) | |
tree | 7bee01c0f92b2536cb6850cdfbb4d040b61ab8a2 /cmd-show-options.c | |
parent | 6ebb1df8fe161678c3550e59774ec4894551ba3e (diff) | |
download | rtmux-ff90170738dad3ab6d302790672c57a3e10e9075.tar.gz rtmux-ff90170738dad3ab6d302790672c57a3e10e9075.tar.bz2 rtmux-ff90170738dad3ab6d302790672c57a3e10e9075.zip |
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.
Diffstat (limited to 'cmd-show-options.c')
-rw-r--r-- | cmd-show-options.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/cmd-show-options.c b/cmd-show-options.c index 8406cc16..4b4a809e 100644 --- a/cmd-show-options.c +++ b/cmd-show-options.c @@ -1,4 +1,4 @@ -/* $Id: cmd-show-options.c,v 1.14 2009-07-14 06:43:33 nicm Exp $ */ +/* $Id: cmd-show-options.c,v 1.15 2009-07-15 17:44:47 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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; |