Skip to content

Commit

Permalink
Use integer as getopt_long returns integer
Browse files Browse the repository at this point in the history
ARM chars are unsigned by default. getopt_long return 255 instead -1.
That will cause an endless loop for aarch64 platform.

Signed-off-by: Honggang Li <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Acked-by: Jonathan Toppins <[email protected]>
Signed-off-by: Leon Romanovsky <[email protected]>
  • Loading branch information
Honggang-LI authored and rleon committed Apr 26, 2017
1 parent 0576db2 commit 2a46668
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rdma-ndd/rdma-ndd.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ int main(int argc, char *argv[])
{ }
};

char c = getopt_long(argc, argv, "fh", long_opts, &opt_idx);
int c = getopt_long(argc, argv, "fh", long_opts, &opt_idx);
if (c == -1)
break;

Expand Down

0 comments on commit 2a46668

Please sign in to comment.