mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
style. we use calloc
This commit is contained in:
parent
d906f23a0a
commit
482a6464a2
6 changed files with 7 additions and 7 deletions
|
@ -452,7 +452,7 @@ int main(int argc, char *argv[]) {
|
|||
void *status;
|
||||
|
||||
// make the table of tables
|
||||
t = (struct table *)malloc(sizeof(struct table) * 65536);
|
||||
t = (struct table *)calloc(sizeof(struct table) * 65536, sizeof(uint8_t));
|
||||
if (!t) {
|
||||
printf("malloc failed\n");
|
||||
exit(1);
|
||||
|
|
|
@ -196,7 +196,7 @@ static void *crack(void *d) {
|
|||
numnrar = data->numnrar;
|
||||
|
||||
// create space for tables
|
||||
Tk = (struct Tklower *)malloc(sizeof(struct Tklower) * 0x40000);
|
||||
Tk = (struct Tklower *)calloc(sizeof(struct Tklower) * 0x40000, sizeof(uint8_t));
|
||||
if (!Tk) {
|
||||
printf("Failed to allocate memory (Tk)\n");
|
||||
exit(1);
|
||||
|
@ -314,7 +314,7 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
|
||||
// create table of nR aR pairs
|
||||
TnRaR = (struct nRaR *)malloc(sizeof(struct nRaR) * NUM_NRAR);
|
||||
TnRaR = (struct nRaR *)calloc(sizeof(struct nRaR) * NUM_NRAR, sizeof(uint8_t));
|
||||
|
||||
// open file
|
||||
fp = fopen(argv[2], "r");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue