Skip to content

Commit

Permalink
Update BAMstructs.c
Browse files Browse the repository at this point in the history
Increased memory allocation by one for the index file
  • Loading branch information
pongorlorinc authored Apr 17, 2019
1 parent 0fe526c commit 6253f58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BAMstructs.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int CheckIndexFile(char *fname) {
if(fname == NULL)
return 0;

char *idx = (char *)calloc(strlen(fname) + 4, sizeof(char));
char *idx = (char *)calloc(strlen(fname) + 5, sizeof(char));
strcpy(idx, fname);
strcat(idx, ".bai");

Expand Down Expand Up @@ -102,4 +102,4 @@ void PrintBAMstructs(BAMFILES *head) {
printf("File: %s\n\tID:%d\n\tNo. of reads: %d\n\tScale: %f\n", curr->name, curr->id, curr->read_coverage, curr->scale);
curr = curr->next;
}
}
}

0 comments on commit 6253f58

Please sign in to comment.