summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2014-07-16 15:16:34 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-17 06:55:01 +0000
commita9b0d15e6e781dc57f3c5739cfd2f80db03adbd4 (patch)
tree0c819f55199c9ebf6a22e9625466b5be93704747
parent0bd3a932db5add8cac7c91e75b513ec07344bc8b (diff)
downloadchrome-ec-a9b0d15e6e781dc57f3c5739cfd2f80db03adbd4.tar.gz
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 <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/208489 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--common/i2c.c2
1 files changed, 1 insertions, 1 deletions
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;