From 71a37da06bcd06290ef05aa6027c84b7f8b4287c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 20 Feb 2026 19:15:47 +0100 Subject: Fix parsing of options with arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- sshexec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sshexec.c') diff --git a/sshexec.c b/sshexec.c index 7f49530..ff7efe0 100644 --- a/sshexec.c +++ b/sshexec.c @@ -587,10 +587,10 @@ parse_ssh_options(char *argv[], size_t *nopts_out) /* Option cannot have an argument */ } else if (strchr(arged_opts, opt)) { /* Option must have an argument */ - if (arg[1]) { + if (*arg) { /* Argument is attached to option */ break; - } else if (argv[1]) { + } else if (*argv) { /* Argument is detached from option */ argv++; nopts++; @@ -657,7 +657,7 @@ main(int argc_unused, char *argv[]) if (!strcmp(destination, "-")) exitf("%s: the command argument must not be \"-\"\n", argv0); else if (strchr(destination, '=')) - exitf("%s: the command argument must contain an \'=\'\n", argv0); + exitf("%s: the command argument must not contain an \'=\'\n", argv0); /* Parse command line operands */ extract_directory_from_destination(); -- cgit v1.2.3-70-g09d2