commit | 799a9eb388c5418da37c327fc7316e4c423b8913 | [log] [tgz] |
---|---|---|
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | Fri Feb 23 10:58:51 2018 +0200 |
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | Wed Feb 28 16:17:13 2018 +0200 |
tree | 685f2549c16c6d155f25c3ef0ba468aeb266ab8a | |
parent | 23b257aa47b62e2921eb8abc30129a28304c93fe [diff] |
shared/shell: Fix not reseting optind Not reseting optind may crash the tool if getopt and variants are called a second time.
diff --git a/src/shared/shell.c b/src/shared/shell.c index b57ae1b..5e9e5ea 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c
@@ -829,6 +829,7 @@ data.argc = argc - optind; data.argv = argv + optind; + optind = 0; data.mode = (data.argc > 0); if (data.mode)