mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
Merge branch 'master' into desf_update2
This commit is contained in:
commit
a20db915df
7 changed files with 177 additions and 102 deletions
|
@ -313,10 +313,7 @@ int CLIGetOptionList(struct arg_str *argstr, const CLIParserOption *option_array
|
|||
|
||||
int val = -1;
|
||||
int cntr = 0;
|
||||
for (int i = 0; i < CLI_MAX_OPTLIST_LEN; i++) {
|
||||
// end of array
|
||||
if (option_array[i].text == NULL)
|
||||
break;
|
||||
for (int i = 0; i < CLI_MAX_OPTLIST_LEN && option_array[i].text != NULL; i++) {
|
||||
// exact match
|
||||
if (strcmp(option_array[i].text, data) == 0) {
|
||||
*value = option_array[i].code;
|
||||
|
@ -345,10 +342,8 @@ int CLIGetOptionList(struct arg_str *argstr, const CLIParserOption *option_array
|
|||
|
||||
const char *CLIGetOptionListStr(const CLIParserOption *option_array, int value) {
|
||||
static const char *errmsg = "n/a";
|
||||
|
||||
for (int i = 0; i < CLI_MAX_OPTLIST_LEN; i++) {
|
||||
if (option_array[i].text == NULL)
|
||||
break;
|
||||
|
||||
for (int i = 0; i < CLI_MAX_OPTLIST_LEN && option_array[i].text != NULL; i++) {
|
||||
if (option_array[i].code == value)
|
||||
return option_array[i].text;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue