Skip to content

Commit

Permalink
Retype opt from char to int as char may be unsigned on ARM ar…
Browse files Browse the repository at this point in the history
…chitectures.
  • Loading branch information
merkys committed Jun 30, 2022
1 parent 2fffe56 commit 6184e94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ static int
parse_arg(int argc, char **argv, struct cli_state *state)
{
int alg_set = 0;
char opt;
int opt;
int n_opt = 'z' + 1;
char opt_set['z' + 1];
int option_index = 0;
Expand All @@ -540,7 +540,7 @@ parse_arg(int argc, char **argv, struct cli_state *state)

while ((opt = getopt_long(argc, argv, options_string,
long_options, &option_index)) != -1) {
opt_set[(int)opt] = 1;
opt_set[opt] = 1;
/* Assume arguments starting with dash are actually missing arguments */
if (optarg != NULL && optarg[0] == '-') {
if (option_index > 0)
Expand Down

0 comments on commit 6184e94

Please sign in to comment.