Commit 20f87e78 authored by dp-arm's avatar dp-arm
Browse files

fiptool: Initialize opt_index to 0 for getopt(3)



Change-Id: I62c1a636eb0d9f73fa3a6356e32b5a44f268d421
Signed-off-by: default avatardp-arm <dimitris.papastamos@arm.com>
parent 60b499fe
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment