mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
Use memset to zero memory for better code style.
This commit is contained in:
parent
de99fee83c
commit
42d0c6d8c1
1 changed files with 3 additions and 9 deletions
|
@ -2263,9 +2263,7 @@ void SimTagIso15693(uint8_t *uid, uint8_t block_size) {
|
||||||
security_offset = 1;
|
security_offset = 1;
|
||||||
}
|
}
|
||||||
uint8_t resp_readblock[response_length];
|
uint8_t resp_readblock[response_length];
|
||||||
for (int i = 0; i < response_length; i++) {
|
memset(resp_readblock, 0, response_length);
|
||||||
resp_readblock[i] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
resp_readblock[0] = 0; // Response flags
|
resp_readblock[0] = 0; // Response flags
|
||||||
for (int j = 0; j < block_count; j++) {
|
for (int j = 0; j < block_count; j++) {
|
||||||
|
@ -2279,9 +2277,7 @@ void SimTagIso15693(uint8_t *uid, uint8_t block_size) {
|
||||||
EmlGetMemIso15693(block_size, resp_readblock + (work_offset + security_offset),
|
EmlGetMemIso15693(block_size, resp_readblock + (work_offset + security_offset),
|
||||||
block_size * (block_idx + j));
|
block_size * (block_idx + j));
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < block_size; i++) {
|
memset(resp_readblock + work_offset + security_offset, 0, block_size);
|
||||||
resp_readblock[work_offset + security_offset + i] = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2321,9 +2317,7 @@ void SimTagIso15693(uint8_t *uid, uint8_t block_size) {
|
||||||
// Build WRITE_(MULTI_)BLOCK response
|
// Build WRITE_(MULTI_)BLOCK response
|
||||||
int response_length = 3;
|
int response_length = 3;
|
||||||
uint8_t resp_writeblock[response_length];
|
uint8_t resp_writeblock[response_length];
|
||||||
for (int i = 0; i < response_length; i++) {
|
memset(resp_writeblock, 0, response_length);
|
||||||
resp_writeblock[i] = 0;
|
|
||||||
}
|
|
||||||
resp_writeblock[0] = 0; // Response flags
|
resp_writeblock[0] = 0; // Response flags
|
||||||
|
|
||||||
// CRC
|
// CRC
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue