mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
Cliparser fix
Fix CLIGetStrwithRetrun Allows casting and requires the buffer length to be passed in. Existing uses of the function have been updated.
This commit is contained in:
parent
8aa70b37e3
commit
bb59250eca
6 changed files with 16 additions and 7 deletions
|
@ -203,11 +203,11 @@ CLIGetHexWithReturn(\<context\>, \<opt index\>, \<store variable\>, \<ptr to sto
|
|||
quick test : seems res_keylen == 0 when ok so not key len ???
|
||||
|
||||
**string option return**
|
||||
CLIGetStrWithReturn(\<context\>,\<opt index\>, \<unsigned char \*\>, \<int \*\>);
|
||||
CLIGetStrWithReturn(\<context\>,\<opt index\>, \<uint8_t \*\>, \<int \*\>);
|
||||
If failed to retrieve string, it will exit fct
|
||||
|
||||
uint8_t buffer[100];
|
||||
int slen = 0;
|
||||
int slen = sizeof(buffer); // <- slen MUST be the maximum number of characters that you want returned. e.g. Buffer Size
|
||||
CLIGetStrWithReturn(ctx, 1, buffer, &slen);
|
||||
|
||||
**string option**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue