style. we use calloc

This commit is contained in:
iceman1001 committed 2024-01-07 20:47:07 +01:00
1 parent d906f23a0a
commit 482a6464a2
6 files changed
+7 -7

No files matched your search

@@ -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);
+2 -2
View File
@@ -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");