summaryrefslogtreecommitdiff
path: root/src/fracture.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fracture.c')
-rw-r--r--src/fracture.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fracture.c b/src/fracture.c
index 260f04f..dbe9ff5 100644
--- a/src/fracture.c
+++ b/src/fracture.c
@@ -186,9 +186,9 @@ int main(int argc, char *argv[]) {
char *a_filename;
if (save_cluster_dist) {
cluster_size_dist =
- (uint32_t *)malloc(max_verts * sizeof(uint32_t));
+ (uint32_t *)calloc(max_verts, sizeof(uint32_t));
avalanche_size_dist =
- (uint32_t *)malloc(max_edges * sizeof(uint32_t));
+ (uint32_t *)calloc(max_edges, sizeof(uint32_t));
c_filename = (char *)malloc(filename_len * sizeof(char));
a_filename = (char *)malloc(filename_len * sizeof(char));
@@ -241,7 +241,7 @@ int main(int argc, char *argv[]) {
char *d_filename;
if (save_damage) {
damage =
- (uint32_t *)malloc(max_edges * sizeof(uint32_t));
+ (uint32_t *)calloc(max_edges, sizeof(uint32_t));
d_filename = (char *)malloc(filename_len * sizeof(char));
snprintf(d_filename, filename_len, "damg_%c_%c_%c_%d_%g_%g.dat", lattice_c, boundc, boundc2, L, beta, crack_len);