mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
chg: use calloc
This commit is contained in:
parent
e81b0fa355
commit
99b6087b01
7 changed files with 9 additions and 9 deletions
|
@ -405,7 +405,7 @@ int nonce_distance(uint32_t from, uint32_t to)
|
|||
{
|
||||
uint16_t x, i;
|
||||
if(!dist) {
|
||||
dist = malloc(2 << 16);
|
||||
dist = calloc(2 << 16, sizeof(uint8_t));
|
||||
if(!dist)
|
||||
return -1;
|
||||
for (x = i = 1; i; ++i) {
|
||||
|
@ -443,7 +443,7 @@ static uint32_t fastfwd[2][8] = {
|
|||
*/
|
||||
uint32_t *lfsr_prefix_ks(uint8_t ks[8], int isodd)
|
||||
{
|
||||
uint32_t *candidates = malloc(4 << 10);
|
||||
uint32_t *candidates = calloc(4 << 10, sizeof(uint8_t));
|
||||
if (!candidates) return 0;
|
||||
|
||||
uint32_t c, entry;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
uint64_t * radixSort(uint64_t * array, uint32_t size) {
|
||||
rscounts_t counts;
|
||||
memset(&counts, 0, 256 * 8 * sizeof(uint32_t));
|
||||
uint64_t * cpy = (uint64_t *)malloc(size * sizeof(uint64_t));
|
||||
uint64_t * cpy = (uint64_t *)calloc(size * sizeof(uint64_t), sizeof(uint8_t));
|
||||
uint32_t o8=0, o7=0, o6=0, o5=0, o4=0, o3=0, o2=0, o1=0;
|
||||
uint32_t t8, t7, t6, t5, t4, t3, t2, t1;
|
||||
uint32_t x;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue