Fix out-of-bounds access if no iteration performed

This commit is contained in:
Patrick Lühne 2018-01-26 18:55:11 +01:00
parent bf2400fd98
commit 36472346f8
No known key found for this signature in database
GPG Key ID: 05F3611E97A70ABF
1 changed files with 2 additions and 2 deletions

4
main.c
View File

@ -247,7 +247,7 @@ void printStatistics()
if(flagOutputDIMACS == 0) {
printf("iterations:\n");
int i = 0;
do {
while(i*outputTimeStep+firstTimePoint < lastTimePoint && seqs[i].sati) {
printf(" - horizon: %i\n",seqs[i].sati->nOfTPoints-1);
printf(" result: ");
if (seqs[i].sati->value == 0)
@ -261,7 +261,7 @@ void printStatistics()
printf(" decisions: %i\n",seqs[i].sati->decisions);
printf(" variables: %i\n",seqs[i].sati->nOfVars);
i += 1;
} while(i*outputTimeStep+firstTimePoint <= lastTimePoint && seqs[i].sati);// && seqs[i-1].sati->value != 1);
}// && seqs[i-1].sati->value != 1);
// } while(i*outputTimeStep+firstTimePoint < lastTimePoint);
}