mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-25 00:25:48 +08:00
try to fix coverity
This commit is contained in:
parent
8a598ce33c
commit
84eb4e4597
1 changed files with 2 additions and 7 deletions
|
@ -313,10 +313,7 @@ int CLIGetOptionList(struct arg_str *argstr, const CLIParserOption *option_array
|
||||||
|
|
||||||
int val = -1;
|
int val = -1;
|
||||||
int cntr = 0;
|
int cntr = 0;
|
||||||
for (int i = 0; i < CLI_MAX_OPTLIST_LEN; i++) {
|
for (int i = 0; i < CLI_MAX_OPTLIST_LEN && option_array[i].text != NULL; i++) {
|
||||||
// end of array
|
|
||||||
if (option_array[i].text == NULL)
|
|
||||||
break;
|
|
||||||
// exact match
|
// exact match
|
||||||
if (strcmp(option_array[i].text, data) == 0) {
|
if (strcmp(option_array[i].text, data) == 0) {
|
||||||
*value = option_array[i].code;
|
*value = option_array[i].code;
|
||||||
|
@ -346,9 +343,7 @@ int CLIGetOptionList(struct arg_str *argstr, const CLIParserOption *option_array
|
||||||
const char *CLIGetOptionListStr(const CLIParserOption *option_array, int value) {
|
const char *CLIGetOptionListStr(const CLIParserOption *option_array, int value) {
|
||||||
static const char *errmsg = "n/a";
|
static const char *errmsg = "n/a";
|
||||||
|
|
||||||
for (int i = 0; i < CLI_MAX_OPTLIST_LEN; i++) {
|
for (int i = 0; i < CLI_MAX_OPTLIST_LEN && option_array[i].text != NULL; i++) {
|
||||||
if (option_array[i].text == NULL)
|
|
||||||
break;
|
|
||||||
if (option_array[i].code == value)
|
if (option_array[i].code == value)
|
||||||
return option_array[i].text;
|
return option_array[i].text;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue