diff options
author | Ting Shen <phoenixshen@google.com> | 2021-01-12 16:52:25 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-12 11:10:12 +0000 |
commit | 4f5cce3e8612ecf598842ae2147e1ee5bc27789e (patch) | |
tree | f437fd0ed9bddbc21bfc7fdaefe6d1bf00946bd2 /extra | |
parent | a08fad13eda5d04372c66f66a299f4ddb70b26b7 (diff) | |
download | chrome-ec-4f5cce3e8612ecf598842ae2147e1ee5bc27789e.tar.gz |
usb_updater2: fix incorrect console output
argv[optind] is the index of next arg to be processed,
what we want to print here is actually argv[optind - 1].
BUG=None
TEST=Run `usb_updater2 -d 18d1:503c -p 208.0_2.0.bin` on Krane and check
console output.
Before this CL:
read 65536(0x10000) bytes from (null)
After:
read 65536(0x10000) bytes from 208.0_2.0.bin
BRANCH=main
Signed-off-by: Ting Shen <phoenixshen@google.com>
Change-Id: I45f584672f9c264d350374b43a3dd074b4a4ff7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2623990
Tested-by: Ting Shen <phoenixshen@chromium.org>
Auto-Submit: Ting Shen <phoenixshen@chromium.org>
Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Commit-Queue: Eric Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'extra')
-rw-r--r-- | extra/usb_updater/usb_updater2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extra/usb_updater/usb_updater2.c b/extra/usb_updater/usb_updater2.c index 971a977e55..12ee1615fc 100644 --- a/extra/usb_updater/usb_updater2.c +++ b/extra/usb_updater/usb_updater2.c @@ -1113,7 +1113,7 @@ int main(int argc, char *argv[]) data = get_file_or_die(optarg, &data_len); printf("read %zd(%#zx) bytes from %s\n", - data_len, data_len, argv[optind]); + data_len, data_len, argv[optind - 1]); break; case 'r': |