diff options
| author | Martin Birgmeier <d8zNeCFG@aon.at> | 2021-10-07 05:20:56 +0000 |
|---|---|---|
| committer | Robert Wing <rew@FreeBSD.org> | 2021-10-07 05:56:20 +0000 |
| commit | 67bceb38f463d8a929c55efdcfcfefc9aedfeff6 (patch) | |
| tree | 8b835fb61f38767a969b7c9db07caf837fdf378d | |
| parent | 4d7876aa70e2b7c7c941399a61b6f5e5f8fee088 (diff) | |
| download | src-67bceb38f463d8a929c55efdcfcfefc9aedfeff6.tar.gz src-67bceb38f463d8a929c55efdcfcfefc9aedfeff6.zip | |
i2c(8): fix option handling
Recognize the '-o' option when processing command line arguments.
Fixes: 9c10d00bf8cd ("i2c(8): Add interpreted mode for batch/scripted...")
PR: 258572
| -rw-r--r-- | usr.sbin/i2c/i2c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/i2c/i2c.c b/usr.sbin/i2c/i2c.c index 87bb1f0fe983..2ab7c55772de 100644 --- a/usr.sbin/i2c/i2c.c +++ b/usr.sbin/i2c/i2c.c @@ -744,7 +744,7 @@ main(int argc, char** argv) struct options i2c_opt; const char *dev, *err_msg; int fd, error = 0, ch; - const char *optflags = "a:f:d:o:w:c:m:n:sbvrh"; + const char *optflags = "a:f:d:o:iw:c:m:n:sbvrh"; char do_what = 0; dev = I2C_DEV; @@ -763,7 +763,7 @@ main(int argc, char** argv) /* Find out what we are going to do */ - while ((ch = getopt(argc, argv, "a:f:d:iw:c:m:n:sbvrh")) != -1) { + while ((ch = getopt(argc, argv, optflags)) != -1) { switch(ch) { case 'a': case 'i': |
