7
mirror of https://github.com/EEVengers/ThunderScope.git synced 2025-04-22 17:43:44 +00:00

fix getopt

This commit is contained in:
profezzorn 2022-01-30 20:45:37 -08:00
parent 43f0a0083e
commit 218ec6e1eb

View File

@ -72,13 +72,14 @@ int mygetopt(int argc, char** argv) {
if (strncmp(options[i].name, argv[optind] + 2, len)) continue;
if (options[i].needs_argument) {
if (!arg) continue;
if (argv[optind] +2 + len != arg) continue;
if (argv[optind] + 2 + len != arg) continue;
optarg = arg + 1;
} else {
if (arg) continue;
if (argv[optind][2 + len]) continue;
optarg = NULL;
}
optind++;
return options[i].return_value;
}
return -1;