From a24efe483b587f2af13fad29de6580fdd64a8407 Mon Sep 17 00:00:00 2001 From: chrisrfq Date: Mon, 5 Oct 2020 13:53:08 -0700 Subject: Update i2ctools.c Fix i2cdetect parameter reading so "last" value is read from correct argument. --- toys/other/i2ctools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/other') 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"); } -- cgit v1.2.3