diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-08-20 19:50:18 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-08-20 19:50:18 +0000 |
commit | 720f841059a27643e512b0f9ac54c28b316e79d8 (patch) | |
tree | 1fd6c606c266b70bc640fe63d054f44396a2d43d /usr.bin/tmux/cmd.c | |
parent | 4ac13be589b12b0ebd28925105fd98cfb8e400e5 (diff) |
Hide struct args behind a couple of accessor functions.
Diffstat (limited to 'usr.bin/tmux/cmd.c')
-rw-r--r-- | usr.bin/tmux/cmd.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c index 92d14f458e3..343375c5f48 100644 --- a/usr.bin/tmux/cmd.c +++ b/usr.bin/tmux/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.165 2021/08/20 19:34:51 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.166 2021/08/20 19:50:17 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -518,13 +518,10 @@ cmd_parse(int argc, char **argv, const char *file, u_int line, char **cause) return (NULL); cmd_log_argv(argc, argv, "%s: %s", __func__, entry->name); - args = args_parse(entry->args.template, argc, argv); + args = args_parse(entry->args.template, argc, argv, entry->args.lower, + entry->args.upper); if (args == NULL) goto usage; - if (entry->args.lower != -1 && args->argc < entry->args.lower) - goto usage; - if (entry->args.upper != -1 && args->argc > entry->args.upper) - goto usage; cmd = xcalloc(1, sizeof *cmd); cmd->entry = entry; |