diff options
author | Dawei Li <daweili@google.com> | 2015-08-13 15:34:11 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-08-14 02:25:55 +0000 |
commit | 68088eb93fe2d275b4347ac25479d6b6cce52dd9 (patch) | |
tree | 6094278ec069f41fbdf25ca324d70601b2a48e2e | |
parent | 36ed861be833df5751c668fdc1b47fb00e3ebada (diff) | |
download | chrome-ec-68088eb93fe2d275b4347ac25479d6b6cce52dd9.tar.gz |
twinkie: bug fix for injector.c:cmd_bufrd
bug: when typing
> tw bufrd 3 2
in twinkie console, the command will output 3 elements
However, the third argument(3) is where it starts output
the elements; and the fourth argument(2) is the number
of elements to be printed.
Original code uses: "cnt = strtoi(argv[0], &e, 10);" to
get the count.
It should use "cnt = strtoi(argv[1], &e, 10);" instead.
Signed-off-by: Dawei Li <daweili@google.com>
Change-Id: I04cf041e47cdf72c5189e4b8446c8f8e4cc5e2e5
Reviewed-on: https://chromium-review.googlesource.com/293561
Tested-by: Dawei Li <daweili@google.com>
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Commit-Queue: Sheng-liang Song <ssl@chromium.org>
-rw-r--r-- | board/twinkie/injector.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/board/twinkie/injector.c b/board/twinkie/injector.c index 62e1ccd940..6f5dc8d583 100644 --- a/board/twinkie/injector.c +++ b/board/twinkie/injector.c @@ -492,7 +492,7 @@ static int cmd_bufrd(int argc, char **argv) return EC_ERROR_PARAM2; if (argc >= 2) - cnt = strtoi(argv[0], &e, 10); + cnt = strtoi(argv[1], &e, 10); if (*e || idx + cnt > INJ_CMD_COUNT) return EC_ERROR_PARAM3; |