mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-11-11 01:55:38 +08:00
Remove gcc 12.1 warning: strncpy specified bound depends on the length of the source argument
This commit is contained in:
parent
d7e69fefee
commit
c4a8e0fa2e
1 changed files with 3 additions and 3 deletions
|
@ -1510,10 +1510,10 @@ static int CmdRawDemod(const char *Cmd) {
|
|||
};
|
||||
|
||||
//
|
||||
size_t n = MIN(strlen(Cmd), 4);
|
||||
char tmp[7];
|
||||
char tmp[5];
|
||||
size_t n = MIN(strlen(Cmd), sizeof(tmp) - 1);
|
||||
memset(tmp, 0, sizeof(tmp));
|
||||
strncpy(tmp, Cmd, n);
|
||||
strncpy(tmp, Cmd, sizeof(tmp) - 1);
|
||||
|
||||
CLIExecWithReturn(ctx, tmp, argtable, false);
|
||||
bool ab = arg_get_lit(ctx, 1);
|
||||
|
|
Loading…
Reference in a new issue