summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authordp-arm <dimitris.papastamos@arm.com>2016-11-07 11:13:54 +0000
committerdp-arm <dimitris.papastamos@arm.com>2016-12-05 10:38:49 +0000
commit20f87e78e39d70fd5f65779ebdc4dd16299e26b9 (patch)
tree4fba3a4245d31c2b023db20b5324f76e0974c135 /tools
parent60b499feacb12888ccfba476b9d1ce2441859611 (diff)
fiptool: Initialize opt_index to 0 for getopt(3)
Change-Id: I62c1a636eb0d9f73fa3a6356e32b5a44f268d421 Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/fiptool/fiptool.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/fiptool/fiptool.c b/tools/fiptool/fiptool.c
index e3cdeef0..f53e9ab3 100644
--- a/tools/fiptool/fiptool.c
+++ b/tools/fiptool/fiptool.c
@@ -570,7 +570,7 @@ static int create_cmd(int argc, char *argv[])
add_opt(opts, ++i, NULL, 0, 0);
while (1) {
- int c, opt_index;
+ int c, opt_index = 0;
c = getopt_long(argc, argv, "", opts, &opt_index);
if (c == -1)
@@ -641,7 +641,7 @@ static int update_cmd(int argc, char *argv[])
add_opt(opts, ++i, NULL, 0, 0);
while (1) {
- int c, opt_index;
+ int c, opt_index = 0;
c = getopt_long(argc, argv, "o:", opts, &opt_index);
if (c == -1)
@@ -728,7 +728,7 @@ static int unpack_cmd(int argc, char *argv[])
add_opt(opts, ++i, NULL, 0, 0);
while (1) {
- int c, opt_index;
+ int c, opt_index = 0;
c = getopt_long(argc, argv, "fo:", opts, &opt_index);
if (c == -1)
@@ -845,7 +845,7 @@ static int remove_cmd(int argc, char *argv[])
add_opt(opts, ++i, NULL, 0, 0);
while (1) {
- int c, opt_index;
+ int c, opt_index = 0;
c = getopt_long(argc, argv, "fo:", opts, &opt_index);
if (c == -1)