Reset optind and optopt for second getopt loop

pull/1195/head
jsteube 7 years ago
parent 378f852cec
commit 9558fcc012

@ -281,6 +281,16 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
}
}
if (optopt != 0)
{
event_log_error (hashcat_ctx, "Invalid argument specified");
return -1;
}
optind = 1;
optopt = 0;
option_index = 0;
while (((c = getopt_long (argc, argv, short_options, long_options, &option_index)) != -1) && optopt == 0)

Loading…
Cancel
Save