From a9b0d15e6e781dc57f3c5739cfd2f80db03adbd4 Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Wed, 16 Jul 2014 15:16:34 -0700 Subject: I2C console command bug fix We are now using argv[5] even if the user only gives 5 arguments. Fix it. BUG=None TEST=Read with i2cxfer command and doesn't see "Invalid param 5" BRANCH=None (this can be worked around by adding a dummy param) Change-Id: Ice13fec4ad53c71b6529daa3510fa6fc1d7f8c00 Signed-off-by: Vic Yang Reviewed-on: https://chromium-review.googlesource.com/208489 Reviewed-by: Randall Spangler --- common/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/i2c.c') diff --git a/common/i2c.c b/common/i2c.c index 82e36f6c25..fa7ad64519 100644 --- a/common/i2c.c +++ b/common/i2c.c @@ -637,7 +637,7 @@ static int command_i2cxfer(int argc, char **argv) if (*e) return EC_ERROR_PARAM4; - if (argc >= 5) { + if (argc >= 6) { v = strtoi(argv[5], &e, 0); if (*e) return EC_ERROR_PARAM5; -- cgit v1.2.1