mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
CHG: 'mem load' - adapted loading files to use new load function.
loading binary file can be called with NULL pointer, don't forget to free it.
This commit is contained in:
parent
eb4310395e
commit
25b07682dc
2 changed files with 27 additions and 45 deletions
|
@ -184,7 +184,11 @@ int loadFile(const char *preferredName, const char *suffix, void* data, size_t*
|
|||
goto out;
|
||||
}
|
||||
|
||||
memcpy(data, dump, bytes_read);
|
||||
if ( (data) == NULL) {
|
||||
(data) = calloc( bytes_read, sizeof(uint8_t));
|
||||
}
|
||||
|
||||
memcpy( (data), dump, bytes_read);
|
||||
free(dump);
|
||||
|
||||
PrintAndLogDevice(SUCCESS, "loaded %d bytes from binary file %s", bytes_read, fileName);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue