Improved the fasta parser for better memory handling and better parsing
of the last parts of fasta headers (definitions)
This commit is contained in:
@ -76,7 +76,7 @@ element_from_header** check_and_realloc_mem_in_header_table(element_from_header*
|
||||
{
|
||||
(*nbf)++;
|
||||
|
||||
if (*nbf == *memory_allocated)
|
||||
if ((*nbf)+1 == *memory_allocated)
|
||||
{
|
||||
(*memory_allocated)++;
|
||||
*p_header = (element_from_header*) realloc(*p_header, (*memory_allocated) * sizeof(element_from_header));
|
||||
@ -87,7 +87,6 @@ element_from_header** check_and_realloc_mem_in_header_table(element_from_header*
|
||||
|
||||
void end_header_table(element_from_header** p_header, int nbf)
|
||||
{
|
||||
nbf = nbf - 1;
|
||||
//fprintf(stderr, "nbf = %d", nbf);
|
||||
*p_header = (element_from_header*) realloc(*p_header, nbf * sizeof(element_from_header));
|
||||
sprintf((*p_header)->value, "%d", nbf);
|
||||
}
|
||||
|
Reference in New Issue
Block a user