rambaut / Seq-Gen

Sequence simulator
51 stars 17 forks source link

Added +1 to the checkCapacity function call #2

Closed fredericlemoine closed 8 years ago

fredericlemoine commented 8 years ago

Hi,

Wanting to generate sequences from a newick tree having 1449 taxa, I had a seg fault. It appeared that while reading a new tip (readTip function) the checkcapacity function was called before incrementing the tree numtips. Then at the moment of the capacity increase, the current taxon was "forgotten", thus having a null name and a null sequence and provoking the segfault at writeSequences.

You can reproduce the error with the attached tree.txt file: ./seq-gen -of -a0.441 -g4 -mWAG -l527 -z $RANDOM tree.txt > seq.fasta

tree.txt

I propose to add "+1" to checkCapacity called in the readTip function. I don't know if the proposed modification may break other parts of your code,

Best,

Frederic

rambaut commented 8 years ago

Been meaning to fix this bug for years. Thanks.