aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrisrfq <chrisrfq@gmail.com>2020-10-05 13:53:08 -0700
committerRob Landley <rob@landley.net>2020-10-05 21:46:42 -0500
commita24efe483b587f2af13fad29de6580fdd64a8407 (patch)
tree9021fe84ff52309f1f7336dde545e6dfd002641d
parentce683cdce2629721339f526c5059af9b3042958e (diff)
downloadtoybox-a24efe483b587f2af13fad29de6580fdd64a8407.tar.gz
Update i2ctools.c
Fix i2cdetect parameter reading so "last" value is read from correct argument.
-rw-r--r--toys/other/i2ctools.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/other/i2ctools.c b/toys/other/i2ctools.c
index c9a11466..cd1b892c 100644
--- a/toys/other/i2ctools.c
+++ b/toys/other/i2ctools.c
@@ -196,7 +196,7 @@ void i2cdetect_main(void)
bus = atolx_range(*toys.optargs, 0, INT_MAX);
if (toys.optc == 3) {
first = atolx_range(toys.optargs[1], 0, 0x7f);
- last = atolx_range(toys.optargs[1], 0, 0x7f);
+ last = atolx_range(toys.optargs[2], 0, 0x7f);
if (first > last) error_exit("first > last");
}