Skip to content

Commit

Permalink
Merge pull request #2187 from wh201906/return
Browse files Browse the repository at this point in the history
Use defined return value
  • Loading branch information
iceman1001 authored Nov 25, 2023
2 parents 56b5bde + 10ab013 commit 9a705f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions client/src/cmdsmartcard.c
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ int ExchangeAPDUSC(bool verbose, uint8_t *datain, int datainlen, bool activateCa
int len = smart_responseEx(dataout, maxdataoutlen, verbose);
if (len < 0) {
free(payload);
return 1;
return PM3_ESOFT;
}

// retry
Expand All @@ -1419,13 +1419,13 @@ int ExchangeAPDUSC(bool verbose, uint8_t *datain, int datainlen, bool activateCa
len = smart_responseEx(dataout, maxdataoutlen, verbose);
if (len < 0) {
free(payload);
return 1;
return PM3_ESOFT;
}
}

free(payload);
*dataoutlen = len;
return 0;
return PM3_SUCCESS;
}

bool smart_select(bool verbose, smart_card_atr_t *atr) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/iso7816/iso7816core.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int Iso7816ExchangeEx(Iso7816CommandChannel channel, bool activate_field, bool l
res = ExchangeAPDUSC(false, data, datalen, activate_field, leave_field_on, result, (int)max_result_len, (int *)result_len);
}

if (res) {
if (res != PM3_SUCCESS) {
return res;
}
break;
Expand Down

0 comments on commit 9a705f1

Please sign in to comment.