Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 0994b3a3 authored by David Parsons's avatar David Parsons
Browse files

fix memory issue when aevol_create is called providing a sequence file

introduced by ad7fef6b
parent 54d0cfd2
No related branches found
No related tags found
No related merge requests found
......@@ -91,10 +91,10 @@ int main(int argc, char* argv[]) {
exit(EXIT_FAILURE);
}
lchromosome = strlen(raw_chromosome) - 1;
chromosome = new char[lchromosome]; // Warning: will become the DNA of the
// first individual created -> do not
// delete, will be freed in Dna
strncpy(chromosome, raw_chromosome, lchromosome);
chromosome = new char[lchromosome + 1]; // Warning: will become the DNA of the
// first individual created -> do not
// delete, will be freed in Dna
strncpy(chromosome, raw_chromosome, lchromosome + 1);
printf("Loading chromosome from text file %s (%" PRId32 " base pairs) \n",
chromosome_file_name, lchromosome);
fclose(chromosome_file);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment