diff --git a/src/Newickform.c b/src/Newickform.c index abd18e5e..0214f788 100644 --- a/src/Newickform.c +++ b/src/Newickform.c @@ -245,8 +245,9 @@ newick_node* build_newick_tree(char * filename, FILE *vcf_file_pointer,int * snp // Allocate memory to store all sequences // N.B. this can be reduced once memory management improves int num_stored_nodes = num_nodes; - char ** node_sequences = (char **) calloc((number_of_snps + 1)*num_stored_nodes,sizeof(char)); - char ** node_names = (char **) calloc(MAX_SAMPLE_NAME_SIZE*num_stored_nodes,sizeof(char)); + char ** node_sequences = calloc((number_of_snps + 1) * num_stored_nodes, sizeof(char*)); + char ** node_names = calloc(MAX_SAMPLE_NAME_SIZE*num_stored_nodes,sizeof(char)); + for (int seq_store_index = 0; seq_store_index < num_stored_nodes; ++seq_store_index) { node_names[seq_store_index] = " ";