mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 02:27:26 -07:00
make style
This commit is contained in:
parent
0d9223a547
commit
0373696662
483 changed files with 56514 additions and 52451 deletions
|
@ -37,45 +37,45 @@ int getopt(int argc, char *argv[], const char *optstring)
|
|||
char *str;
|
||||
|
||||
if (pos == 0) {
|
||||
if ((optind >= argc) || (*argv[optind] != '-'))
|
||||
return EOF;
|
||||
pos = 1;
|
||||
if (argv[optind][pos] == '\0')
|
||||
return EOF;
|
||||
if ((optind >= argc) || (*argv[optind] != '-'))
|
||||
return EOF;
|
||||
pos = 1;
|
||||
if (argv[optind][pos] == '\0')
|
||||
return EOF;
|
||||
}
|
||||
|
||||
str = strchr(optstring, argv[optind][pos]);
|
||||
if (str == NULL) {
|
||||
optopt = argv[optind][pos];
|
||||
if (opterr)
|
||||
fprintf(stderr, "%s: illegal option -- %c\n", argv[0],
|
||||
optopt);
|
||||
return '?';
|
||||
optopt = argv[optind][pos];
|
||||
if (opterr)
|
||||
fprintf(stderr, "%s: illegal option -- %c\n", argv[0],
|
||||
optopt);
|
||||
return '?';
|
||||
}
|
||||
|
||||
if (str[1] == ':') {
|
||||
if (argv[optind][pos+1] != '\0') {
|
||||
optarg = &argv[optind][pos+1];
|
||||
return *str;
|
||||
}
|
||||
optind++;
|
||||
if (optind >= argc) {
|
||||
optopt = *str;
|
||||
if (opterr)
|
||||
fprintf(stderr, "%s: option requires an argument -- %c\n",
|
||||
argv[0], optopt);
|
||||
return '?';
|
||||
}
|
||||
optarg = argv[optind];
|
||||
optind++; pos = 0;
|
||||
return *str;
|
||||
}
|
||||
else {
|
||||
pos++;
|
||||
if (argv[optind][pos] == '\0') {
|
||||
if (argv[optind][pos + 1] != '\0') {
|
||||
optarg = &argv[optind][pos + 1];
|
||||
return *str;
|
||||
}
|
||||
optind++;
|
||||
if (optind >= argc) {
|
||||
optopt = *str;
|
||||
if (opterr)
|
||||
fprintf(stderr, "%s: option requires an argument -- %c\n",
|
||||
argv[0], optopt);
|
||||
return '?';
|
||||
}
|
||||
optarg = argv[optind];
|
||||
optind++;
|
||||
pos = 0;
|
||||
}
|
||||
return *str;
|
||||
return *str;
|
||||
} else {
|
||||
pos++;
|
||||
if (argv[optind][pos] == '\0') {
|
||||
optind++;
|
||||
pos = 0;
|
||||
}
|
||||
return *str;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue