Skip to content

Commit 725d844

Browse files
author
Shaun Mahony
committed
Merge remote-tracking branch 'origin/master'
2 parents 4d76010 + 2fda01d commit 725d844

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/PlatformSupport.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ int PlatformSupport::ReadTransfacFile(char* fn, bool famNames, bool input, bool
144144
}else{
145145
//Copy the contents of tmp_Motif to a new spot in currMotifs, when the last matrix line is read.
146146
if(curr_cnt != 0){
147+
if(currCnt == MAX_MOTIFS - 1)
148+
{
149+
printf("To many motifs in input file. Increase the value of MAX_MOTIFS in globals.h and recompile.\n");
150+
exit(1);
151+
}
152+
147153
currMotifs[currCnt] = new Motif(curr_cnt);
148154
if(useweighting)
149155
currMotifs[currCnt]->weighting=tmp_Motif->weighting;
@@ -194,6 +200,12 @@ int PlatformSupport::ReadTransfacFile(char* fn, bool famNames, bool input, bool
194200

195201
//Copy the contents of the last tmp_Motif to a new spot in currMotifs, if this was not done yet
196202
if(curr_cnt != 0){
203+
if(currCnt == MAX_MOTIFS - 1)
204+
{
205+
printf("To many motifs in input file. Increase the value of MAX_MOTIFS in globals.h and recompile.\n");
206+
exit(1);
207+
}
208+
197209
currMotifs[currCnt] = new Motif(curr_cnt);
198210
if(useweighting)
199211
currMotifs[currCnt]->weighting=tmp_Motif->weighting;

src/ProteinDomains.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,8 @@ void ProteinDomains::MutualInformation(MultiAlignRec* pssmAlignment, Motif* alig
511511
delete MIConf[i];
512512
delete Minfo;
513513
delete MIConf;
514-
delete ttl_acids;
515-
delete obs_acids;
514+
delete [] ttl_acids;
515+
delete [] obs_acids;
516516
delete posPref;
517517
}
518518

src/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const int AA=20;
3838
const int STR_LEN = 500;
3939
const int LONG_STR=1000;
4040
const double DFLT_NUM_INSTANCES=30.0;
41-
const int MAX_MOTIFS = 10001;
41+
const int MAX_MOTIFS = 100001;
4242
const int MAX_MOTIF_LEN = 200;
4343
const int MAX_MARKOV = 6;
4444
const int maxLen = 25;

0 commit comments

Comments
 (0)