diff options
author | Andreas Fenkart <andreas.fenkart@digitalstrom.com> | 2015-12-09 15:13:25 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-02-08 18:10:32 +0300 |
commit | 1ce686978c03d4fd025c7e93b7a18d4a87f547ec (patch) | |
tree | 85be48a2c124ff643bf84fd714f480dd49a82a19 /tools/env/fw_env_main.c | |
parent | 371ee13760b9e70d1a931afc643de3f4057b4a28 (diff) | |
download | u-boot-1ce686978c03d4fd025c7e93b7a18d4a87f547ec.tar.xz |
tools: env: shift optind arguments and fix argument indices
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
Diffstat (limited to 'tools/env/fw_env_main.c')
-rw-r--r-- | tools/env/fw_env_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c index b68f1bff0c..daf468823f 100644 --- a/tools/env/fw_env_main.c +++ b/tools/env/fw_env_main.c @@ -182,6 +182,10 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } + /* shift parsed flags, jump to non-option arguments */ + argc -= optind; + argv += optind; + lockfd = open(lockname, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (-1 == lockfd) { fprintf(stderr, "Error opening lock file %s\n", lockname); |