MXS-1618 Use right type for the return value of getopt_long

getopt_long returns an 'int'. If 'char' is used on a big-endian
platform you'll end up with an infinite loop.
This commit is contained in:
Johan Wikman 2018-04-24 12:31:08 +03:00
parent 7a81f77649
commit bafe8f5eeb
2 changed files with 2 additions and 2 deletions

View File

@ -142,7 +142,7 @@ main(int argc, char **argv)
bool use_unix_socket = false;
int option_index = 0;
char c;
int c;
while ((c = getopt_long(argc, argv, "h:p::P:u:S:v?ei",
long_options, &option_index)) >= 0)
{

View File

@ -86,7 +86,7 @@ int main(int argc, char **argv)
char *key_file = NULL;
char *aes_algo = NULL;
int report_header = 0;
char c;
int c;
while ((c = getopt_long(argc, argv, "dVfMHK:A:?", long_options, &option_index)) >= 0)
{