From e6b8be952c9bd7374e744d8575467c41319f8dca Mon Sep 17 00:00:00 2001 From: Kevin Howe Date: Tue, 28 Aug 2018 11:15:23 +0100 Subject: [PATCH] Allow for null-terminator in long names (reported by Torsten Seemann) --- include/version.h | 2 +- src/distancemat.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/version.h b/include/version.h index 174ff64..d322e91 100644 --- a/include/version.h +++ b/include/version.h @@ -22,6 +22,6 @@ #define _VERSION #define VERSION_MAJOR 2 -#define VERSION_MINOR 3 +#define VERSION_MINOR 4 #endif diff --git a/src/distancemat.c b/src/distancemat.c index a230bd2..c83492f 100644 --- a/src/distancemat.c +++ b/src/distancemat.c @@ -420,7 +420,7 @@ struct DistanceMatrix *read_phylip_DistanceMatrix( FILE *handle, struct Alignmen /* In PHYLIP format, the distance matrix is symmetrical. However, also cope with a bottom-left matrix */ (*aln_loc)->seqs[i] = empty_Sequence(); - (*aln_loc)->seqs[i]->name = (char *) malloc_util( strlen(identifier) * sizeof(char)); + (*aln_loc)->seqs[i]->name = (char *) malloc_util( (strlen(identifier) + 1) * sizeof(char)); strcpy( (*aln_loc)->seqs[i]->name, identifier ); for (j=0; j < i; j++) { if (! fscanf( handle, "%lf", &dist))